I have searched for an answer but couldn\'t find it anywhere. My question is reasonably simple: I have a background color of my body, then a large margin, and now I want a d
I needed something similar, and came up with using the :before (or :after) pseudoclasses:
#mydiv { background-color: #fbb; margin-top: 100px; position: relative; } #mydiv:before { content: ""; background-color: #bfb; top: -100px; height: 100px; width: 100%; position: absolute; }
JSFiddle