code_junkie

Is there an easy way to change the color of a bullet in a list?

Nov 10th, 2011
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. <ul>
  2. <li><span>item #1</span></li>
  3. <li><span>item #2</span></li>
  4. <li><span>item #3</span></li>
  5. </ul>
  6.  
  7. li {
  8. color: red; /* bullet color */
  9. }
  10. li span {
  11. color: black /* text color */
  12. }
  13.  
  14. <ul>
  15. <li style="color: #888;"><span style="color: #000">test</span></li>
  16. </ul>
  17.  
  18. li:before {
  19. color: pink;
  20. }
  21.  
  22. <ul style="color: red;">
  23. <li>One</li>
  24. <li>Two></li>
  25. <li>Three</li>
  26. </ul>
  27.  
  28. <ul>
  29. <li style="color:#ddd;"><span style="color:#000;">List Item</span></li>
  30. </ul>
  31.  
  32. li { color: red; }
  33. li b { color: black; font_weight: normal; }
  34. .c1 { color: red; }
  35. .c2 { color: blue; }
  36. .c3 { color: green; }
  37.  
  38. <ul>
  39. <li><b>Text 1</b></li>
  40. <li><b>Text 2</b></li>
  41. <li><b>Text 3</b></li>
  42. </ul>
  43.  
  44. <ul>
  45. <li class="c1"><b>Text 1</b></li>
  46. <li class="c2"><b>Text 2</b></li>
  47. <li class="c3"><b>Text 3</b></li>
  48. </ul>
  49.  
  50. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  51. <html>
  52. <head>
  53. <style type="text/css">
  54. li {
  55. list-style: none;
  56. }
  57.  
  58. li:before {
  59. /* For a round bullet */
  60. content:'2022';
  61. /* For a square bullet */
  62. /*content:'25A0';*/
  63. display: block;
  64. position: relative;
  65. max-width: 0px;
  66. max-height: 0px;
  67. left: -10px;
  68. top: -0px;
  69. color: green;
  70. font-size: 20px;
  71. }
  72. </style>
  73. </head>
  74.  
  75. <body>
  76. <ul>
  77. <li>foo</li>
  78. <li>bar</li>
  79. </ul>
  80. </body>
  81. </html>
  82.  
  83. <li style='color:#e0e0e0'>something</li>
Add Comment
Please, Sign In to add comment