Forum Moderators: not2easy
float:right with width:20em. On the left side, I have the main div. Everything looks fine until I added background-color for the div#main h4. Somehow the background color extended all the way to the right of the screen and messed up the floating div. Any idea on how to limit the background to the border of a floating div?
Thanks
-Mongo
Your other option is to make the width of the h4 explicit, left aligned, it defaults to full page width, like all block level elements.
I just redid a whole site to be fully percent based to avoid these problems, all margins, padding, and borders are percent sized, that makes the pages totally fluid, it works really well, just pick percents that will look ok on 800x600 and 1024x768 and you'll be fine
So make the right floated box 25%, that looks like it would be about right, maybe 28 or 30%, then make the h4 be around 75%, play with it, it will work fine then.