Problem stretching the content around a parent div
Hi!
I'm learning html and css, and I always use clear:both at the end of a container to strech it. However since the parent div has a margin child, it does not stretch. Could anybody explaim me why, and how to solve it?
here is how my css looks:
* {
margin: 0px;
padding: 0px;
background-color: black;
}
body {
width: 900px;
margin: 50px auto auto auto;
position: centered;
}
I want the the container to expand around the block and blue.square, but since both div contain margin it does not expand. If I remove the margin the ccs file it expands, but it doesnt expand with the margin. I want to know how i can expand the container while keeping margin.
Bookmarks