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

External links

7 Responses to “Generic content and semantics”

  1. Peter Vigren Says:

    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. :-)

  2. Jens Says:

    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.

  3. icaaq Says:

    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,

  4. Jens Says:

    icaaq: That’s is true and very semantic correct, but it wouldn’t work right now with little support.

  5. icaaq Says:

    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.

  6. icaaq Says:

    wtf, how do I write HTML in this comment?

    <div id="one" class="generic">Lorum ipsum…</div>

  7. Jens Says:

    hehe, I know, Wordpress like to munch on code examples. Last one was a good one.

Leave a Reply


Jens Wedin Mail me Portfolio