Click to See Complete Forum and Search --> : Setting different styles for diffeternt UL types
eva valenta
07-01-2003, 10:28 AM
Is is possible to set different styles for different UL types?
I know ho to set a an image for the UL tag, for example:
<style type="text/css">
<!--
ul {list-style-image:url(http://forums.webdeveloper.com/images/smilies/smile.gif)}
-->
</style>
Now I would like to set an other image for <UL TYPE=square> and an other one for <UL TYPE=circle>
How may I do that?
/Eva:confused:
Jonathan
07-01-2003, 12:45 PM
You must name them... Here, this is a code for the circle things..
<style type="text/css">
<!--
UL.YOUR_classification
{
list-style-image:url(http://forums.webdeveloper.com/images/smilies/smile.gif)
}
UL.YOUR_second_classification
{
list-style-type: circle
}
UL.YOUR_third_classification
{
list-style-type: square
}
-->
</style>
<!-- The following goes in the body -->
<ul class="YOUR_classification">
<li>Your words</li>
<li>Your words</li>
<li>Your words</li>
<li>Your words</li>
</ul>
<ul class="YOUR_second_classification">
<li>Your words</li>
<li>Your words</li>
<li>Your words</li>
<li>Your words</li>
</ul>
<ul class="YOUR_third_classification">
<li>Your words</li>
<li>Your words</li>
<li>Your words</li>
<li>Your words</li>
<li>Your words</li>
</ul>
nkaisare
07-01-2003, 01:03 PM
Another valid way (not yet supported in IE) is:
ul[type="square"] {
list-style-image:url(smile.gif);
}
Read about it: http://www.w3.org/TR/REC-CSS2/selector.html#q1
----
of course, as jonathan said, you can have
<ul class="maker1">
<li>...
</ul>
ul.marker1 { list-style-image: url(smile.gif) }
This is your best choice as it will be displayed properly in IE as well as other browsers like NS6+, Opera etc.
eva valenta
07-02-2003, 02:22 AM
I figured out the class="something" by myself. I was kind of hoping for something like
ul[type="square"] . But it does not work in the IE browser we are using (5.5)
The thing is, the user has a tool to write information in a Rich text field and he/she is allowed to create bulleted list and even choose the type of the list. But usualy, he is not using HTML, even if it is possible. I was hoping we could give him the posibility to use different lists with different types and put the correct image out by the CSS.
Well, I quess I have to learn them some HTML then.
Thanks anyway
/Eva