Why is there 0 margin when viewed on jsfiddle?

How do I fix this?

Does something need to be adjusted?

Margin visible here:
.html
http://htmledit.squarefree.com/
http://jsbin.com/padidaroda/edit?html,output

CodePen

0 margin here:
https://jsfiddle.net/hvzn2pvp/4/

I think jsfiddle does their image codes differently, or all their codes.

What margin are you expecting to see?

Absolute positioning takes an element out of the default flow of elements, so things like default margin will have no effect.

Browsers usually add default margins/paddings to elements.

  1. squarefree.com has h3 and p elements, both of which have default margins.

  2. w3schools try it page uses a body element which has a default margin.

  3. jsbin uses a body element which has a default margin.

  4. jsfiddle hvzn2pvp/4/ has no elements with margins, default or otherwise.

coothead

7 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.