.A { margin: 10px 10px 10px 10px; border: 10px solid red; padding: 10px 10px 10px 10px; background-color: blue; color: white; } .B { margin: 10px 10px 10px 10px; border: 10px solid red; padding: 10px 0px 10px 0px; background-color: yellow; color: black; } .C { margin: 10px 10px 10px 10px; border: 10px solid red; padding: 0px 0px 0px 0px; background-color: yellow; color: black; }
Note how the horizontal margins do not collapse (20px between elements)
I am an "A" SPAN I am a "B" SPAN I am a "C" SPANNow, for a special trick:
Same SPANs, this time inside a table. I am an "A" SPAN I am a "B" SPAN I am a "C" SPAN |