javascript - how to center div in middle of browser viewport like google -


i have search website needs have search bar , logo centered vertically , horizontally in index page items on page.

what best , effective way implementing this

for css-only approach check out fiddle. http://jsfiddle.net/jeffrod/nfths/

it requires width , height of center box known. positions top left of box in middle , then, using margins, shifts center of box @ center of page.


Comments

Popular posts from this blog

haskell - Using filter on an item in a list? -

c# - When does PreApplicationStartMethod actually get triggered to run? -

tomcat6 - Exception when stopping container for a with Spring + Quartz + Tomcat web application -