negative margin

Negative top and left margins move the element up and left while negative right and bottom margins make following siblings move left and up.

Vertical margins have no effect on non-replaced inline elements.

When the margin value is set using percentage, it is calculated with respect to the width of the generated box’s containing block (this is true for all four margins).

In IE6, styling static elements with negative margin may clip them. The fix for this bug is to use position:relative.

Try These

Watch This


Check This

<div id="aqua">aqua</div> <div id="yellow">yellow</div> <div id="pink">pink</div>

Edit This

Use shift + enter to create new lines (even in Safari and Chrome).