Forum Moderators: not2easy

Message Too Old, No Replies

CSS Layout - box model hack

         

gavinmcnamee

4:01 pm on Jan 23, 2007 (gmt 0)

10+ Year Member



I was wondering if there are any other basic css layout hacks I should be aware of other than the box model hack?

Could anyone please point me to a good tutorial or explanation of this hack that is very clear and easy to understand.

Thanks

mep00

7:39 pm on Jan 23, 2007 (gmt 0)

10+ Year Member



Generally, if possible, hacks should be avoided. One problem with using a hack is that if a newer browser is released which fixes the defect that which the hack takes advantage of, but doesn't fix the reason the hack was used in the first place, you end up with broken css. This is some thing which has happened with the "* html" hack and IE7. Where possible, the best solution is try to find an alternate way to achieve the same effect (such as using a bottom border instead of an underline).

Another possible alternative which applies to IE (the most likely reason to want to hack in the first place) is to use "conditional comments [msdn.microsoft.com]." while there is some debate as to whether or not conditional comments should be considered hacks, if used properly, they are the safest way to feed (or not feed) something different (not just css) to IE only.

For more information on css bugs, hacks, and other techniques, I highly recommend the following two sites:
[css-discuss.incutio.com...]
[positioniseverything.net...]