PDA

View Full Version : UL and LI


Daybreak_0
11-14-2003, 03:35 PM
In my stylesheet I have defined UL and LI

Below that I have defined a class say .classUL and .classLI

In my html I have the following

<ul class="classUL">
<li class="classLI">text</li>
<li class="classLI">text</li>
<li class="classLI">text</li>
</ul>


I have searched but can't seem to find anything on this but -

Why do my UL and LI definitions overide the class definition.

I originally had a div surrounding the list and had the following defined

.surroundingdiv UL { }and also
.surroundingdiv UL LI { }

but again the original definitions for UL and LI kept overiding the other definitions.

Do I have to forgo defining a default UL and LI? as I am inheriting styles I do not want

Regards
Day

raym
12-06-2003, 11:59 AM
This works as expected for me:

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

<style type="text/css">
ul { background-color: yellow; }
li { color: red; }
.classUL { background-color: green; }
.classLI { color: yellow; }
</style>

</head>
<body>
<ul class="classUL">
<li class="classLI">text</li>
<li class="classLI">text</li>
<li class="classLI">text</li>
</ul>
</body>
</html>

Daybreak_0
12-06-2003, 06:05 PM
Try different fonts like Arial for UL and LI and
Times for .classUL and .classLI

interested in the result

Regards
Day

raym
12-06-2003, 09:22 PM
Still works. BTW, 1st Page 2K in realtime preview mode is a great way to play with this stuff.

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

<style type="text/css">
ul { background-color: yellow; padding: 10px; font-family: arial, san-serif; }
li { color: red; }
.classUL { background-color: darkblue; }
.classLI { color: yellow; font-family: "times new roman", serif; }
</style>

</head>
<body>
<ul class="classUL">
<li class="classLI">Now Is The Time</li>
<li class="classLI">For All Good Men</li>
<li class="classLI">To Come To The Aid</li>
</ul>
</body>
</html>

Daybreak_0
12-07-2003, 01:37 AM
hmmm agree

I had someone else look at my code at the time, and they could not figure out why it was affecting it. Anyway got around the problem.

Thanks

Day