|
Posted by Jonathan N. Little on 06/30/06 18:09
Jim Higson wrote:
> Luigi Donatello Asero wrote:
>
>> 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
>
>
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
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|