Generic content and semantics
This is more of a semantic question than a post.
Say you are designing a site, the content area you want have four boxes, they should not look the same and you do not know what kind of content they have. What kind of class or id names would you use?
Example:
<div id="generic-box-1">Lorum ipsum...</div>
Related Posts:
- None

March 11th, 2007 at 5:29 pm
Hm… a bit tricky one. But why wouldn’t you know what their content would be? I am a bit tired so I’m maybe not thinking so fast right now but I can’t come up with an example of this… But your approach with “generic-box-1″ sounds relatively sound to me. But maybe box shouldn’t be there to be even more semantic I guess… at least in my mind. And since div is already “specified”, the concept that the content is separated from the rest is already in place. So “generic1″ or something is probably what I would use. But I really would be interested in an example.
March 11th, 2007 at 6:01 pm
For example when building a template for a page where you donīt add the content yourself. The content is added by editors and writers and you donīt know what they can come up with. Sometimes they want to write an news item in a box and sometimes they add some contact info. The reason I need to the “boxes” to be identified is that I want them to look different.
March 12th, 2007 at 11:03 am
In a ideal world I would have used some selectors like:
#wrapper + div{ background: #f00; } #wrapper + div + div{ background: #ff0; }But, i believe you have to support some less CSS-supported browsers as well so then I think I would have marked it up like this:
Lorum ipsum…
Cheers,
March 12th, 2007 at 11:33 am
icaaq: That’s is true and very semantic correct, but it wouldn’t work right now with little support.
March 12th, 2007 at 11:52 am
Something went wrong when I wrote the last part, so I try again: … But, i believe you have to support some less CSS-supported browsers as well so then I think I would have marked it up like this:
Lorum ipsum…
…
Cheers again.
March 12th, 2007 at 11:55 am
wtf, how do I write HTML in this comment?
<div id="one" class="generic">Lorum ipsum…</div>
March 12th, 2007 at 12:17 pm
hehe, I know, Wordpress like to munch on code examples. Last one was a good one.