Deprecated: Assigning the return value of new by reference is deprecated in /home/shan/public_html/mahudsblog/wp-content/plugins/sem-recent-comments/sem-recent-comments.php on line 971
mahud’s blog: Paint Shop Pro Tutorials and Proboard Templates » Bullet images for list items

mahud's blog

Paint Shop Pro Tutorials, ProBoards Templates, Downloads and More Stuff

< Styling Links | RSS Icon Paint Shop Pro Tutorial >

Bullet images for list items

5 Dec 2006 > 0 Comments

Creating a <div> based Template using CSS (Part: 11)


Bullet Images can be added to lists using the CSS property list-style-image:, but it can get tricky aligning the bullet properly in different browsers.

Instead I use the property background-image:

In the stylesheet, I’ve added the image to the li type selector, along with the property and value to stop the image from repeating:

li {list-style-type:none;
background-image:url(images/bullet.jpg);
background-repeat:no-repeat;}
b1.jpg

Next, I’ll add some padding:

li {list-style-type:none;
background-image:url(images/bullet.jpg);
background-repeat:no-repeat;
padding:0 1em;}
b2.jpg

To position the image use the background-position property. For more info on positioning background images refer back to Styling the Background and Foreground.

li {list-style-type:none;
background-image:url(images/bullet.jpg);
background-repeat:no-repeat;
padding:0 1em;
background-position:0 4px;}
b3.jpg

Finally, the background-image needs to be removed from the horizontal navi bar.

b4.jpg

To do this, I’ve added background-image:none;, to #c1 li

#c1 li {display:inline;
padding:0 0.5em 0 0;
background-image:none;}

< Back to everything
Keep going… >

Related Posts

No Comments (Have your say)

  1. smile
  2. happy
  3. sad
  4. wink
  5. url
  6. bquote
  7. bold
  8. acronym
  9. abbr
  10. cite
  11. code
  12. em

Why Markup when you can Markdown?

Menu

logopv.jpg

Mahud Version 5 © 2006-2008 > powered by Mr Whippy Wordpress