Image bullets on unordered list

This is a discussion on "Image bullets on unordered list" within the Web Page Design section. This forum, and the thread "Image bullets on unordered list are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 15th, 2007, 15:54
New Member
Join Date: Aug 2007
Location: Norfolk, England
Age: 23
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Image bullets on unordered list

Hi, I’m trying to make an unordered list of links with image bullet points, I want it so that when you mouse over a link it changes the bullet point to a different image. I’ve got this far without any problems however if I put something in my unordered list that is not a link it doesn’t display any bullet point. Here is the code I am using:

Code: Select all
<html>
<head>

<style type="text/css">

ul.sidelist {
list-style:none;
}

.sidelist li a  {
background:url('bullet.png') no-repeat center left;
padding-left:10px;
}

.sidelist li a:hover {
background:url('bullet2.png') no-repeat center left; 
}

</style>
</head>
<body>

<ul class="sidelist">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
<li><a href="#">Link 5</a></li>
<li>Without Link</a></li>
</ul>

</body>
</html>
If I try adding the following code I get two bullet points on links and one on non-links:

Code: Select all
.sidelist li {
background:url('bullet.png') no-repeat center left;
}
Reply With Quote

  #2 (permalink)  
Old Aug 15th, 2007, 16:00
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image bullets on unordered list

Unfortunately, the only way to achieve the "hover" effect is through link using the a element like you did in your first example simply for the fact that IE doesn't support hover and anything other than links.

So ... you could do

Code: Select all
.sidelist li {
background:url('bullet.png') no-repeat center left;
}

.sidelist li:hover {
background:url('bullet2.png') no-repeat center left;
}
but it won't work in IE

BTW ... instead of using 2 images for the normal and hover states ... combine them This will get rid of the annoying flicker when a new user comes to your site and hovers over the links

http://wellstyled.com/css-nopreload-rollovers.html

Last edited by karinne; Aug 15th, 2007 at 16:03.
Reply With Quote
  #3 (permalink)  
Old Aug 15th, 2007, 16:06
New Member
Join Date: Aug 2007
Location: Norfolk, England
Age: 23
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image bullets on unordered list

Thanks for the quick reply.

I was afraid this would be the case. I think I might use your example and just leave IE without a mouse over.

What do you mean by combine them?
Reply With Quote
  #4 (permalink)  
Old Aug 15th, 2007, 16:09
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image bullets on unordered list

Yeah ... stuff like that is so minimal that it doesn't hinder the readability of the site so it's used quite alot
Reply With Quote
  #5 (permalink)  
Old Aug 15th, 2007, 18:27
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 21
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Image bullets on unordered list

Or you could use JS to add this functionality.

Pete.
Reply With Quote
Reply

Tags
css

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
unordered list - strange behavior pesho318i Web Page Design 9 Dec 6th, 2007 14:19
IE7 bug: list bullets aligned to bottom MikeHopley Web Page Design 6 Sep 12th, 2007 19:56
unordered list problem in FF alexgeek Web Page Design 4 Sep 10th, 2007 15:26
Unordered list under background image AdRock Web Page Design 4 Aug 7th, 2006 12:43
CSS Unordered List Problem relph2 Web Page Design 3 Jan 7th, 2006 18:14


All times are GMT. The time now is 06:05.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43