It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CSS Forum Script-archive

Understanding Margins, Padding, Borders, Ect...

Share your completed scripts.

Understanding Margins, Padding, Borders, Ect...

Postby HotNoob on Wed Sep 22, 2010 3:04 am

Have you ever had trouble figuring out which is which when using the margins style?
It's quite simple!

Rather than using margin-left, margin-right, margin-top, and margin-bottom, you can use the margin style.
but, it can be quite confusing right? wrong. All you have to do is remember something that almost everyone knows.
North, East, South, West, or Never Eat Soggy Worms.

Here is why.
On a map, or in this instance, the top is always north!
So the right is East, Left, is West, and Bottom is South.

With that knowledge now the Margin Style makes sense!

margin: North East South West;
margin: Top Right Bottom Left;

Now let's put this to use!
What side is the white space on for:
Code: Select all
<style>
.something
{
margin: 0px 0px 10px 0px;
}
</style>

Code: Select all
<style>
.something
{
margin: 10px 0px 10px 0px;
}
</style>

Code: Select all
<style>
.something
{
margin: 0px 10px 0px 0px;
}
</style>

Code: Select all
<style>
.something
{
margin: 0px 0px 0px 10px;
}
</style>

Code: Select all
<style>
.something
{
margin: 10px 10px 10px 10px;
}
</style>


Answers:
Bottom
Top and Bottom
Right
Left
All arround

Remember: Never, Eat, Soggy, Worms. NESW

Well, Hope i helped!
HotNoob
100+ Club
 
Posts: 169
Joined: Sun May 02, 2010 1:38 am

Who is online

Users browsing this forum: No registered users and 0 guests