Hello, how can i set div position at the center of the page with size, for example, 80%/80%.
UPD: margin: 0 auto; works, but only for horizontal alignment. And i also need vertical.
Hello, how can i set div position at the center of the page with size, for example, 80%/80%.
UPD: margin: 0 auto; works, but only for horizontal alignment. And i also need vertical.
Set a fixed width and auto-margins.
<style type="text/css">
#center {
width:300px;
margin-left:auto;
margin-right:auto;
}
</style>
<body>
<div id="center"></div>
</body>
This does what you want, but it is not pretty.
<div style="margin: 0 auto;width:80%;height:80%;">
This will probably not work for you however because you did not provide code
</div>