In the middle of width and height

This is the simple way to make sure your content always in the middle and centering of around

#content {
width: 590px;
margin-left: -295px; /* 1/2 width*/
height: 300px;
margin-top: -150px; /*1/2 height */
position: absolute;
left: 50%;
top:50%;
}

<div id=”horizon”>
<div id=”content”>

</div>
</div>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s