December 5, 201015 yr Hello Ive had trouble with this for a while now any help would be appreciated. If I have all of the content within a container floating left, my container doesn't wrap around the content in live view on dreamweaver, so I have floated the container too and it wraps but voids my auto margin and doesn't center anymore. I think it might have something to do with the positioning of the content within the container but I still havent got my head around that so... can anyone help please? Thanks
December 5, 201015 yr See if any of the examples here http://www.wickham43.net/threecolumns.php show what you want.
December 5, 201015 yr are you clearing your floats? Make sure you clear them Also avoid the dreamweaver preview, it's buggy. Take a look here (scroll down to floats in practice), http://www.smashingmagazine.com/2009/10/19/the-mystery-of-css-float-property/
December 5, 201015 yr Author Thanks everyone Iv tried to work through it with the given advice but I still have the problem. I have cleared my floats and the container still wont wrap I have got a few books from the library and Ive been reading them today but still got no further. The problem only occurs when the container doesn't have a fixed height, it is set to auto. and the position is relative.
December 12, 201015 yr well, the W3C standards says that any container with floated element should have with and height defined, however due to the dynamic content this is not possible to figure out in all designs. However there's a CSS technique that allows you to do that, try to add this CSS selector to your container. myContayner:after {content: " "; display: block; clear: both; height: 0px; visibility: hidden;} it simply adds an element to your code an clear the floats it may content so the container will warp the floated elements as desired.
December 12, 201015 yr add the following to the container css, it will then wrap the border / background around the whole content within the div. overflow:auto;
Create an account or sign in to comment