concept

negative-margin — CSS reference

A negative margin can pull a box or adjacent content toward an edge, depending on layout. Padding and border widths cannot be negative. Overlap may obscure content or controls; use deliberately.

Formal Syntax & Structure

css syntaxcss
margin-left: -10px

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS box geometry lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}#parent{display:flow-root;width:200px;padding-left:20px} #a{width:80px;margin-left:-10px;height:20px}</style><body><div id="parent"><div id="a" class="sample">Box</div></div></body></html>
CSS Reference