HelloARI logo: vinyl signs and identity design home«    web design«    sign design«    photography«    blog«    contact« 

web design and wordpress development 94114
blog»
san frnacisco web design

CSS: How to vertically center content on a page

0 Flares 0 Flares ×

Do you have a  page where you want to simply center it both vertically and horizontally? Looking for a pure CSS solution?

<style type=”text/css”>
html, body   {   height: 100%; margin: 0; padding: 0; text-align: center; }
div#centered { border: 0; height: 50%; width: 50%;position: absolute; left: 25%; top: 25%; }
</style>

For an example visit: http://agentmango.com

In this case, my client wanted it a bit higher than center. Easily done.

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×
This entry was posted in Web Design. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
*

 

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×
© 2016
contact  |  links  |  rss