How can a centre a div inside another div (both vertically and horizontaly) using CSS? My html is
<div class='outer'><div class='inner'></div></div>
And CSS -
.outer{
position: realative;
top:20%;
left20%;
width:500px;
height:500px;
background:red;
}
.inner{
position:relative;
width:100px;
height:100px;
background:#ff2;
/*code to align in centre*/
}