Could one of you fine experst explain this one?

Discussion in 'HTML' started by Richard, Jan 26, 2004.

  1. Richard

    Richard Guest

    <div id="menufooter" class="menus">

    What is the purpose of having both ID and class in the same div tag?

    I'll even accept your explanation brucie.
     
    Richard, Jan 26, 2004
    #1
    1. Advertisements

  2. Richard

    rf Guest

    Go and read the bloody spec. You will find out when you get to the bit about
    scripting and the DOM.

    Cheers
    Richard.
     
    rf, Jan 26, 2004
    #2
    1. Advertisements

  3. Richard

    Kris Guest

    On page A, B and C:
    <div id="menufooter">

    On page D:
    <div id="menufooter" class="menus">

    The footer on page D is a variation of the 'regular' footer, inheriting
    all the styles from #menufooter with a slight touch of extra style mixed
    in by .menus.

    The following CSS illustrates that the footer is black on white on all
    pages and set in bold only on page D.

    #menufooter { color: black; background: white; }
    ..menus { font-weight: bold; }
     
    Kris, Jan 26, 2004
    #3
  4. Richard

    Richard Guest

     
    Richard, Jan 26, 2004
    #4

  5. You wouldn't understand anyway st00pid.
     
    Alexander Cain, Jan 26, 2004
    #5
  6. Richard

    rf Guest

    Out of context it's hard to say what the author had im mind. However, I
    would not do the above. Something like
    <div class="menus specialmenu"> would be more appropriate for adding a
    special property to an individual div of class menus.

    <div id="menufooter" class="menus"> is more likely to specify a div that is
    of class menus but is also a target of some javascript, via the id
    attribute. There may be many div's with class menus but only one that we
    want to apply this javascript to. What this javascript is is anybodys guess,
    maybe it keeps the div precicely at the bottom of the viewport or something
    equally silly :)

    Cheers
    Richard.
     
    rf, Jan 26, 2004
    #6
  7. Richard

    Kris Guest

    Out of context it's hard to say what the author had im mind. However, I
    would not do the above. Something like
    <div class="menus specialmenu"> would be more appropriate for adding a
    special property to an individual div of class menus.[/QUOTE]

    That it is an individual div makes it eligible for an ID, IMO. An extra
    class is to supply for a variation, that is what classes are for.
    That is one very practical purpose, yes, but not the only reason.
    Hehehe.
     
    Kris, Jan 26, 2004
    #7
  8. Richard

    Richard Guest

    rf wrote:


    Seee www.glish.com and check out the source for the various pages.
    He uses all kinds of secondary "tricks" in the div tag.

    I saw one where he even included <div class="menu" href="/">

    huh?

    Guess I'll have to ask him.
     
    Richard, Jan 26, 2004
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.