06
Dec
08

Coding Tip: Centering an Element With CSS.

A few times I’ve run into snags when centering elements in CSS, but I looked around the web and found this elegant little gem:

#MyClass
{
    left: 50%;
    margin-left: -140px;
    width: 280px;
}

Advertisement

0 Responses to “Coding Tip: Centering an Element With CSS.”



  1. Leave a Comment

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 )

Connecting to %s


Follow

Get every new post delivered to your Inbox.