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. Advertising

  2. Richard

    rf Guest

    "Richard" <anonymous@127.000> wrote in message
    news:...
    > <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.


    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. Advertising

  3. Richard

    Kris Guest

    In article <>,
    "Richard" <anonymous@127.000> wrote:

    > <div id="menufooter" class="menus">
    >
    > What is the purpose of having both ID and class in the same div tag?


    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
    <> (nl)
    <http://www.cinnamon.nl/>
    Kris, Jan 26, 2004
    #3
  4. Richard

    Richard Guest

    Kris wrote:

    > In article <>,
    > "Richard" <anonymous@127.000> wrote:


    >> <div id="menufooter" class="menus">
    >>
    >> What is the purpose of having both ID and class in the same div tag?


    > 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; }


    That's kind of what I was figuring.So if the items appear on the same page,
    then the two styles will work together.
    Richard, Jan 26, 2004
    #4
  5. "Richard" <anonymous@127.000> wrote in message
    news:...
    > <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.



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

    rf Guest

    "Kris" <> wrote in message
    news:4all.nl...
    > In article <>,
    > "Richard" <anonymous@127.000> wrote:
    >
    > > <div id="menufooter" class="menus">
    > >
    > > What is the purpose of having both ID and class in the same div tag?

    >
    > 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; }


    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

    In article <yX6Rb.28683$>,
    "rf" <> wrote:

    > > 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; }

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


    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.

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


    That is one very practical purpose, yes, but not the only reason.

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


    Hehehe.

    --
    Kris
    <> (nl)
    <http://www.cinnamon.nl/>
    Kris, Jan 26, 2004
    #7
  8. Richard

    Richard Guest

    rf wrote:


    > "Kris" <> wrote in message
    > news:4all.nl...
    >> In article <>,
    >> "Richard" <anonymous@127.000> wrote:
    >>
    > >> <div id="menufooter" class="menus">
    > >>
    > >> What is the purpose of having both ID and class in the same div tag?

    >>
    >> 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; }


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



    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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    501
    Henry S. Thompson
    Nov 28, 2005
  2. 466
    Replies:
    9
    Views:
    300
  3. 466
    Replies:
    0
    Views:
    300
  4. Replies:
    4
    Views:
    7,230
    James Kanze
    Jun 6, 2007
  5. fl

    Could you explain this typedef to me?

    fl, Feb 2, 2014, in forum: C Programming
    Replies:
    45
    Views:
    355
    Jorgen Grahn
    Feb 9, 2014
Loading...

Share This Page