i read that you can just use
.all {
margin: auto;
width: 50%;
}
but that doest work for my case because the browser make it auto margin left and right , and it make the width to 50% but it doesnt make my div start from the center. it do that and start in the left ,also all items get messed up. this is my html code
<div class = "all">
<div class="one">
1
</div>
<div class="text">
Januarry 1 2016
</div>
</div>
this is my css code
.all{
display: inline-block;
border: 1px groove;
box-shadow: 5px 5px 10px black;
}
.one {
background-color:green;
color:white;
font-size: 150px;
display: inline-block;
padding-right:120px ;
padding-left: 120px;
padding-top:40px;
padding-bottom:40px;
}
.text {
font-size:25px;
text-align: center;
padding: 30px;
}
so how can i center all of the div (class ("all"))