comments on this code requested. Is everything is ok? What can I improve?

The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

comments on this code requested. Is everything is ok? What can I improve?

Hi

I guess the title of this thread says pretty much everything. I just wanna make sure that there are no 'big mistakes' in my code. If you havee something to say about any improvements that I could make, feel free to speak! It's just a little layout, but before I use the above code in all the pages of my site, I wanna hear the pros!

You have a 95% width and padding of 15px and borders of 2px. This will never add up and at some stage will fail. Use padding on inner elements or use a percentage padding so that you can control it. You can probably get away with the borders without causing too much upset.

Why the backslash extra style as you are offering nothing different to ie6 from the first style (width:90%} so just leave the first one in. Also why is ie 5% less than mozilla this will make your layouts different sizes!

Yes the first value without the backslash is for ie5 and ie5.5. The second value is for ie6 as the other two can't parse the backslash correctly.

If you are offering the same size to all ie browsers then you only need the first value.

For more info on the box model I think I have covered all eventualities in the FAQ section where there is a long explanation and what to do to take account in whatever mode (srtandards or quirks mode) that you are using.

If you are still having problems then post the bit of code you need to apply it to (and what doctype you are using (full, partial, xml prologue etc) and I'll give you the correct version

Note that where you have specified percentages and borders then there is no way to account for this exactly so you will be 4 pixels out whatever you do in your #container style. Also you had ie set to 96% which was the same as the original definition and should have been 98% for ie5 and 5.5. and 96% for ie6. (Assuming you are working in standards mode.)

When you specify min-height then all you need to is to give ie height. Its best to do this with the star selector so that you don't compromise any other browsers and keep your hacks separate and safe. The height auto is then not needed as that is the default anyway.

In one instance you had mixed in the star selector hack and and the child selector hack in one style which effectively meant that ie5 mac would be the only browser you were targetting. I find is safer not to use the child selector to target browsers as ie5 will occasionally read the following style after the child selector as though the selector wasn't there. (If you do use it then test in ie5 to make sure its behaving.)

If you're just addressing ie's faults then its best not to compromise other browsers as mentioned above and use the star selector hack which only ie parses.