How do I add bullet buttons o a list

How would I replace the usual text bullets with graphics (such as a checkmark) to a list such as the following:

<ul>
        <li>
              
        </li>
                <li>
              </li>
                <li>
   </li>
        </ul>


Note: I cleaned out some of the non-relevant code, and I may have gone too far with my butchering, but I think you will get the point!

Thanks

Rowby
LVL 9
Rowby GorenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

downtapCommented:
Here's a link to a great article on it.
http://www.alistapart.com/stories/taminglists/

My suggestion would be to read this part of the article. It talks about placing an image inline. The suggestion above is to change the bullet to one of the standard available list bullets which won't work that well for custom images.


There may be times when you have a list, but you dont want any bullets, or you want to use some other character in place of the bullet. Again, CSS provides a straightforward solution. Simply add list-style: none; to your rule and force the LIs to display with hanging indents. The rule will look something like this:
 
ul {
	list-style: none;
	margin-left: 0;
	padding-left: 1em;
	text-indent: -1em;
	}
Either the padding or the margin needs to be set to zero, with the other one set to 1em. Depending on the bullet that you choose, you may need to modify this value. The negative text-indent causes the first line to be moved to the left by that amount, creating a hanging indent.
 
The HTML will contain our standard UL, but with whatever character or HTML entity that you want to use in place of the bullet preceding the content of the list item. In our case we'll be using &#187;, the right double angle quote: ».

Open in new window

0
Rowby GorenAuthor Commented:
Thanks downtap and JBart_17:

I think I wil be going with JBart's suggestion (but will keep downtaps suggestion for future issues):

If the Ul list had this in the html:  

<h3 class="weblinkinfo_HotDealz">  Hot Deals    </h3>

How would I adjust my modification of your link suggestion -- my version is not workin'...

ul weblinkinfo_HotDealz {
list-style-image: url('/images/splat_orange.gif')
}

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

downtapCommented:
Just so you know. IE6 handles the list-image property badly at times. That's why it's not the most widely used technique for custom bullets.
0
Rowby GorenAuthor Commented:
Ah, so I would be better off using the non image solution at least for the next year or so.

Can you tell me downtap how to use your suggestion per the below:

If the Ul list had this in the html:  

<h3 class="weblinkinfo_HotDealz">  Hot Deals    </h3>

How would I adjust my modification of your link suggestion ..............
0
JBart_17Commented:
i'm no css expert  but try this
ul.weblinkinfo_HotDealz {
list-style-image: url('/images/splat_orange.gif')
}

<ul id="weblinkinfo_HotDealz">
...
</ul>
0
downtapCommented:
Don't get me wrong, you can use the technique, my preference in the past has been to use the inline image technique. Plus, I really trust the coders at a list apart magazine.

First, the css for your list would look like this:

ul {
      list-style: none;
      margin-left: 0;
      padding-left: 1em;
      text-indent: -1em;
      }

If you're using a class for the list, you can, otherwise you can't leave it like that. You may need to adjust the padding or margin depending on the bullet.

Now on to the html, which would like so:

<ul>
<li><h3 class="weblinkinfo_HotDealz"><img src="yourbullet.gif">Hot Deals</h3></li>
</ul>
0
David S.Commented:
I prefer to use background images.

It might look like this:

li {
  list-style: none;
  padding-left: 20px; /* at least the width of the image */
  background: url(check.gif) 0 50% no-repeat;
}

Open in new window

0
Rowby GorenAuthor Commented:
Hi Kravimir (or anyone)

I'm trying your solution with this css:
li {
  list-style: none;
  padding-left: 20px; /* at least the width of the image */
  background: url(http://americatravelnow.com/images/splat_orange.gif) 0 50% no-repeat;
}

On this page.  Look at the list on upper right.

http://americatravelnow.com/

I tried various settings for the padding, but can't seem to get the splat to move to the left.

Any suggestions?
0
David S.Commented:
That's because the "ul.weblinkinfo_HotDealz li" rule is overriding the left padding you're setting in the new rule.

Perhaps this would be a good time for you to read up on specificity:
http://www.sitepoint.com/article/get-specific-css-styles
http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html
http://juicystudio.com/displayarticle.php?page=selector-specificity.php
0
Rowby GorenAuthor Commented:
Kravimir,

Would it help in the specifity if the code related to the actual module name.  For example, the clas for this particular code is    class="weblinkinfo_HotDealz
0
Rowby GorenAuthor Commented:
kravimir, i realize now my previous comment probably didn't make sense based on your most current comment.   Ignore it :)
0
Rowby GorenAuthor Commented:
Hi Kravimir,

Actually I don't have a style called "ul.weblinkinfo_HotDealz li" at the moment.

All I have is  

li {
  list-style: none;
  padding-left: 0px; /* at least the width of the image */
  background: url(http://americatravelnow.com/images/splat_orange.gif) 0 50% no-repeat;
}

So far as I can tell, the following are the only other references to to li and ul in the style sheet are the following snippets:

div.module_menu ul {
      margin: 10px 0;
      padding-left: 20px;
}

div.module_menu ul li a:link, div.module_menu ul li a:visited {
      font-weight: bold;
}

0
David S.Commented:
In the embedded stylesheet in the page you linked to you have this rule:

ul.weblinkinfo_HotDealz li{clear:left;list-style:none;margin-left:0px;padding-left:0px}
0
Rowby GorenAuthor Commented:
------------------  Kravimir ---------------------
In the embedded stylesheet in the page you linked to you have this rule:

ul.weblinkinfo_HotDealz li{clear:left;list-style:none;margin-left:0px;padding-left:0px}
-------------------------------------

Hi
That code might be "embedded" into the programming of the Content Management system I'm using and might not be easily changed.

However, Kravimir, if I add a css modification to the END of the styleshee for the above css -- or if that doesn't work to the header of the page itself -- I think I can fix it.

With that in mind, how can I modify the below to fix the issue of the bullets being too far to the right.
Then I'll probably go and just put it in the header of the page......

ul.weblinkinfo_HotDealz li{clear:left;list-style:none;margin-left:0px;padding-left:0px}
0
David S.Commented:
Simply give it higher specificity. One way is to say that it also needs to be a descendant of the "body" element.

body ul.weblinkinfo_HotDealz li {
  list-style: none;
  padding-left: 20px; /* at least the width of the image */
  background: url(http://americatravelnow.com/images/splat_orange.gif) 0 50% no-repeat;
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rowby GorenAuthor Commented:
thabnks Kravimir.....    I see, adding the body gave it the extra / higher specificity it needed.

Appriciate your help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.