I centered this absolute div:
<div style="
width:800px;
height:190px;
position:absolute;
left:50%;
margin-left:-400px;
border-width:10px;
border-style:solid;">
</div>
In maximized mode, it works normally. But when the width of the browser is smaller the div, I can't scroll to the left of the div, it was cut. I tested on Chrome and IE9
How can I center absolute div in windowed mode? What is the reason it is out of alignment?
You'll probably want to change the
div
's width and height to percent values and then to center it, just do something like this: