<ul class="subsubsection" id="domaener">

  • Thread starter Luigi Donatello Asero
  • Start date
L

Luigi Donatello Asero

Hello,
How do I write ul class and id in an external style sheet?
Are the forms
#domaener.subsubsection ul {
}
and
<ul class="subsubsection" id="domaener">
both accepted
or perhaps wrong?
 
J

Jonathan N. Little

Luigi said:
Hello,
How do I write ul class and id in an external style sheet?
Are the forms
#domaener.subsubsection ul {
}
and
<ul class="subsubsection" id="domaener">
both accepted
or perhaps wrong?

Wrong, that points to a UL that is a *child* of element ID "domaener"
and class "subsubsection".

if you want to style the UL then

#domaener.subsubsection {...} is want you want. The UL is not needed
because only *one* element can be id "domaener", one would write

element.className {...}

to be more specific because you *can* have more than one element that is
class="subsubsection".
 
J

Jim Higson

Luigi said:
Hello,
How do I write ul class and id in an external style sheet?
Are the forms
#domaener.subsubsection ul {
}
and
<ul class="subsubsection" id="domaener">
both accepted
or perhaps wrong?

instead of "subsubsection" it might be neater to use XHTML2 style nesting.
For example, this selector matches a section in a section in a section:

..section .section .section
 
J

Jonathan N. Little

Jim said:
instead of "subsubsection" it might be neater to use XHTML2 style nesting.
For example, this selector matches a section in a section in a section:

.section .section .section

Don't what that has to do XHTML, CSS2.1 does nesting selector just dandy.

..doThis {...}
..doThat {...}

..doThis .doThat { ... can be something different ...}


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<style type="text/css">
.doThis { color: red; }
.doThat { color: green; }
.doThis .doThat { color: blue;}
</style>

</head>
<body>
<div class="doThis">I am red</div>
<div class="doThat">I am green</div>
<div class="doThis">I am red
<div class="doThat">I am blue</div>
<div class="doThis">I am red again</div>
</div>
<div class="doThat">I am green
<div class="doThat">I am still green</div>
<div class="doThis">I am still red</div>
</div>
</body>
</html>

Don't get Luigi confused with XHTML, he is dangerous enough in HTML
 
L

Luigi Donatello Asero

Jim Higson said:
instead of "subsubsection" it might be neater to use XHTML2 style nesting.
For example, this selector matches a section in a section in a section:

.section .section .section


But I use a html doctype....
 
D

dorayme

Jonathan N. Little said:
football? Soccer--yes, American Football--No. But what does this have
to do with your CSS question.

Could you elaborate on this please...

Eliza
 
D

dorayme

And who do you think they'll be up against in the finals?


Brazil.[/QUOTE]

It is all very well this light talk... but there IS A HEAVY
question that seems to escape your conscience... the cheating
dirty rotten low as mongrel way you robbed poor new Australia by
that goal...

er.. sorry... just a moment of blind rage...
 
N

Neredbojias

To further the education of mankind, "Jonathan N. Little"
Ducks are ineffective at removing grass stains.

Maybe, but they're good for other malardies.
 
N

Neredbojias

To further the education of mankind, "Luigi Donatello Asero"
Hello,
How do I write ul class and id in an external style sheet?
Are the forms
#domaener.subsubsection ul {
}
and
<ul class="subsubsection" id="domaener">
both accepted
or perhaps wrong?

The last part is okay but you should do something like this:

#domaener { font-size:5500px; }
ul .subsubsection { color:chartreuse;background:vermillion; }

in the stylesheet.
 
D

dorayme

Could you elaborate on this please...

Eliza
Ducks are ineffective at removing grass stains.[/QUOTE]

You talk of ducks and grass, ducks are efficient in water, grass
is liked by cows.

Eliza
 

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

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top