View Single Post
  #12 (permalink)  
Old 06-02-2009, 01:39 PM
NJ's Avatar
NJ NJ is offline
WebProWorld Pro
 
Join Date: Jul 2006
Location: Missoula, Montana
Posts: 101
NJ RepRank 2
Default Re: CSS div problem - widths and scrolling

Funny that you should bring up that problem! I just took a site with that problem to my CSS class to let them figure out the problem. The site problems were

1) There was no container/wrapper/main layer to hold everything - this didn't cause the problem, but we picked it up anyway.
2) All the styles were internal - no external style sheet
3) Sloppy CSS code - missing semicolons after the last property in each style

Now to the original problem:
4) The two "containing" layers were set to 700px wide.
5) The bottom "containing" layer contained the layers Col1 and Col2 (great naming coventions!)
6) Adding the width of the two layers inside the bottom layer, the padding and the margins came to 700px exactly. So far, so good.
7) However, the bottom containing layer also had 10 px of padding (and a border of 10px).
Conclusion: the math didn't add up.

However, the site renders fine in IE 7 and Mozilla. Only had a problem with IE6.

The most irksome thing, though is that the site was built with a free online CSS template from a .org site. How did they get away with such sloppy code?
__________________
Putting the world of computers into plain English.
http://thecomputergal.com
Reply With Quote