I have code to center a div
on an HTML page.
My problem is that margin: 0 auto
only centers the div
horizontal, but I want it fully centered, so also vertically.
body{
background-position: center;
background: #0a056f;
background: -moz-linear-gradient(45deg, #0a056f 0%, #054fb5 100%);
background: -webkit-linear-gradient(45deg, #0a056f 0%,#054fb5 100%);
background: linear-gradient(45deg, #0a056f 0%,#054fb5 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0a056f', endColorstr='#054fb5', GradientType=1);
}
.login_register_recover_box{
background-color: #fff;
background-position: center;
-moz-box-shadow: 0px 0px 50px 5px #091079;
-webkit-box-shadow: 0px 0px 50px 5px #091079;
box-shadow: 0px 0px 50px 5px #091079;
width: 75%;
margin: 0 auto;
border-radius: 10px;
}
<head>
<link rel="stylesheet" type="text/css" href="assets/custom/reset.css">
<link rel="stylesheet" type="text/css" href="assets/custom/custom1.css">
</head>
<body>
<div class="login_register_recover_box"> fdfdss</div>
</body>
Thank you!