HelloARI logo: vinyl signs and identity design web design«    sign design«    blog«    contact«  USE MY IMAGINATION
web design and wordpress development 94114

san frnacisco web design

CSS: How to vertically center content on a page

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%; }

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

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

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>


© 1996 - 2024
contact  |  links  |  rss