html - Center absolute position div in windowed mode? -


i centered 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, works normally. when width of browser smaller div, can't scroll left of div, cut. tested on chrome , ie9

how can center absolute div in windowed mode? reason out of alignment?

you'll want change div's width , height percent values , center it, this:

top:0; left:0; right:0; bottom:0; margin:auto; position:absolute; 

Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -