code_junkie

How can I give each <li> its own bullet image?

Nov 11th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. <ul id="contact_list">
  2. <li id="phone">Local 604-555-5555</li>
  3. <li id="i18l_phone">Toll-Free 1-800-555-5555</li>
  4. </ul>
  5.  
  6. #contact_list
  7. {
  8. list-style: disc none inside;
  9. }
  10.  
  11. #contact_list #phone
  12. {
  13. list-style-image: url(images/small_wood_phone.png);
  14. }
  15.  
  16. #contact_list #i18l_phone
  17. {
  18. list-style-image: url(images/i18l_wood_phone.png);
  19. }
  20.  
  21. <li id="phone" style="list-style-image: url(images/small_wood_phone.png);">Local 604-555-5555</li>
  22.  
  23. #contact_list li
  24. {
  25. list-style: none;
  26. }
  27.  
  28. #contact_list li#phone
  29. {
  30. list-style-image: url(images/small_wood_phone.png);
  31. }
  32.  
  33. #contact_list li#i18l_phone
  34. {
  35. list-style-image: url(images/i18l_wood_phone.png);
  36. }
  37.  
  38. #contact_list #phone
  39. {
  40. list-style-image: url("/images/small_wood_phone.png");
  41. }
  42.  
  43. #contact_list
  44. {
  45. list-style: none;
  46. }
  47.  
  48. #contact_list li {
  49. padding-left: 20px; /* assumes the icons are 16px */
  50. }
  51.  
  52. #contact_list #phone
  53. {
  54. background: url(images/small_wood_phone.png) no-repeat top left;
  55. }
  56.  
  57. #contact_list #i18l_phone
  58. {
  59. background: url(images/i18l_wood_phone.png) no-repeat top left;
  60. }
  61.  
  62. #contact_list
  63. {
  64. list-style: disc none inside;
  65. }
  66.  
  67. #contact_list #phone
  68. {
  69. background-image: url(images/small_wood_phone.png) no-repeat top left;
  70. padding-left: <image width>px;
  71. }
  72.  
  73. #contact_list #i18l_phone
  74. {
  75. background-image: url(images/i18l_wood_phone.png) no-repeat top left;
  76. padding-left: <image width>px;
  77. }
Add Comment
Please, Sign In to add comment