swa66

msg:3774263 | 3:04 pm on Oct 27, 2008 (gmt 0) |
Interesting. I think of my design as having some sort of common layout for a e.g. a section title (let's say a <h2>). That layout will go in what I apply on h2 via css. If I need an H2 in another context, let's say as a title in a forum section, Obviously I want the result to be different, but I'd probably add an id (e.g.: " <body id="forum">" and then style with "#forum h2 {...}") on a body or other wrapping element to allow me to select these headers independently from those on the rest of the site. Basically I use a higher up parent's ID, to select the element's rendering instead of giving all the elements a class or ID) I'm still convinced adding classes and Id's all over the html is a bad idea unless it represents an inherent part of the content (Let's say you have a manual and you use "warning" paragraphs, sure those <p>'s need to be labeled as such). Also if you have page or section specific styles, you can put them in a separate file and only load them where needed.
|
dreamcatcher

msg:3774346 | 4:42 pm on Oct 27, 2008 (gmt 0) |
IE adds default padding to some block level elements. Always best to set the paddings and margins to 0 to avoid too many headaches. Then style accordingly: div, h1, h2, h3, h4, p, form, label, input, textarea, img, span{ margin:0; padding:0; } dc
|
g1smd

msg:3774360 | 4:57 pm on Oct 27, 2008 (gmt 0) |
I sometimes use classes but often I can get away with using these in the style sheet: div.nav h2 { ... } div.content h2 { ... } to select out which area of the page the h2 is on. Sometimes I'll have a notices or feature box (another div) and the h2 in that is styled with div.content div.notice h2 { ... } or somesuch.
|
Sarah Atkinson

msg:3775263 | 7:20 pm on Oct 28, 2008 (gmt 0) |
A large part of my problem is inheritance and relitive font size On a section I'm working on I styling trying g1smd's idea. I now have 2 differnt type(and styled lists) one is a unbulleted and give one type of data the other is a bulleted and gives another type of data. The bulleted list I created using the .divstyle ul{ }; now that I have started styling the unbulleted lists with a class I find they inherit attributes from the other list leaving me a very fubared css file. making me think that each should have it's own class... maybe the right place is somewhere in between Now if only 'between' had a gps location.
|
g1smd

msg:3775279 | 7:48 pm on Oct 28, 2008 (gmt 0) |
Are the lists at different depths? Perhaps specify the full "route" to the element: div div div.divstyle ul li { ... }
|
Sarah Atkinson

msg:3775298 | 8:27 pm on Oct 28, 2008 (gmt 0) |
nope but once you start getting like that isn't that a bit over complicating things? I'm thinking some mid marriage between class/id style everything and style tags. I also try to only use divs where i have to and keep my semantic html nice and pretty. I'm not sure it is best to add lots of nested divs just for style.
|
g1smd

msg:3775299 | 8:29 pm on Oct 28, 2008 (gmt 0) |
No, not adding anything to the HTML, just being more specific in the CSS so as to exactly match the HTML structure.
|
|