Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list bullet styling 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
hello,

is it possible to change the colour of the bullets in an unordered list, and have the text a different colour?

I did a google and found a link suggesting apply foreground colour to the UL but i did and nothing happened.

can anyone help?

cheers,

1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
1DMF, I came across this code snippet:

Code:
<style type="text/css">
LI.list1 {list-style: circle outside; color:green;}
LI.list2 {list-style: square inside; color:blue}
.blacktext {color:black}
</style>

<ul>
<li class="list2"><span class="blacktext">This is one black line</span>
<li class="list2">This is another line that is much longer than the first. But it isn't a black line since we did not specify a style for the text that goes here other than the style we defined for the list.

</ul>

It appears if you set the color of the list item <li> the bullet changes the color of the <li> specified color. Then you put the text of the <li> in a <span> with a different color specified. That will give you the results you want.



<.

 
so basically you have to add an additional wrapper to enable colour formatting, you can't actually say I want X colour text & Y colour bullets perae.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Yes, that is correct, there is no separate specification for bullet color and list item text color.

<.

 
worked great, thanks!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top