Great post. Thank you very much Sophie. Sadly, doing things by ID is a pain when dealing with generated elements from asp.net, since the IDs are made up on the fly. I can generate my CSS programmatically and do everything by ID, but that's far from ideal. If nothing else, though, I have less fear of creating too many classes now.
Thank you, Ray at work > -----Original Message----- > From: Sophie Dennis [mailto:[EMAIL PROTECTED] > Firstly, you can basically always use ID as an alternative to an inline > style. Sometimes you don't gain very much in simple code > efficiency/maintenance terms. You just shift the rules from the HTML > file to the CSS file - the overall amount of code is pretty much the > same. You may therefore occasionally decide an inline style is OK. I > think the situations where you wouldn't be better with a class or ID > (inline styles as inherently evil aside) are very rare, and very > specific, and mostly don't apply to forms... > > On a form, most of your input elements already have a unique ID. So you > can use this ID to style specific elements where you need to, e.g. if > you want zip code to appear a specific length, and your zip code box has > the obvious ID, then "input#zipcode {width: 8ex}" would get you a box > roughly 8 characters wide. If you have several zip code boxes just > combine them into one CSS rule, e.g. "input#zipcode1, input#zipcode2 > {width: 8ex}". <snip /> ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
