DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Add Style To Bulleted Or Numbered List

04.28.2007
| 4155 views |
  • submit to reddit
        // This is a styling for you numbered or bulleted list, works perfectly on firefox, safari and ie 

ul {
	display: block;
	padding-left: 0;
	margin-left: 5px;
	list-style-type: none;
	text-decoration: none;
	text-align:left; }

ul li {
	margin-top: 2px;
	padding-bottom: 2px;
	padding-left: 20px; /* set to width of the image, bullet.png with some extra padding to it to prevent text from sticking to the image */
	line-height: 16px; /* set to height of the image, bullet.png */
	background: transparent url(images/bullet.png) 0% 0% no-repeat; /* this image is 16 by 16 pixel */
}