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!


