Could one of you fine experst explain this one?

R

Richard

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

rf

Richard said:
<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.
 
K

Kris

Richard said:
<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; }
 
R

Richard

Kris said:
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.
 
A

Alexander Cain

Richard said:
<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.
 
R

rf

Kris said:
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.
 
K

Kris

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.[/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.
<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.
 
R

Richard

rf wrote:

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top