Css div control


I’m becoming awake of my lack of css/div control knowledge.

Can someone point me out when it happens that div margin wont apply between divs?

What should you do, when you have image inside a div and you would like the div size to extend - be dominated by the image?

Thanks for help.

Probably collapsing margins. Have a look at this article

If the link above doesn’t clear up the problem then provide some code and an example of what you can’t get to work and we’ll explain what’s going on.

Collapsing margins are quite a complicated but important concept to grasp.

There are also margin issues between floated and non floated content in that the margin of a non floated element will slide under the adjacent float until it hits the containing block. You would need to put the margin on the float instead to move the static content out of the way.