i'm trying to center layout using many ways, but still not find the best way how to do it. in my code below, the button rental
not be in center. i think it because the margin-left but i'm not find anything. i'm always have a problem to make something to center. please help how the best way to do it. and can i make a margin between class="val" ?
this is my example code
a.button {
margin-top: 10px;
background-color: #008CBA;
font-size: 16px;
padding: 12px 28px;
border-radius: 2px;
border: 2px solid #008CBA;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
-webkit-appearance: button;
-moz-appearance: button;
appearance: button;
text-decoration: none;
color: white;
margin-bottom: 10px;
}
.button:hover {
background-color: #3399ff;
color: white;
border: 3px solid #008CBA;
}
ul{
list-style-type: none;
margin-top: 10px;
padding: 0;
/*overflow: hidden;*/
/*width: 20%;*/
/*margin-bottom: 10PX;*/
}
li{
float: left;
}
li button {
background-color: #008CBA;
}
#pencetan{
display: table;
margin: 0 auto;
}
<div id="pencetan">
<ul>
<li><button id="less">-</button></li>
<li><div id="val">1</div></li>
<li><button id="add">+</button></li>
<ul>
<a href="/details " class="button">Rental</a>
</div>