list-style-image not working in Mozilla Firefox - any ideas?

Hello everyone again!

I have this code in my CSS

ul#mainnav ul.subnav li a:hover {
      color:#167B9F;
      list-style-image: url(images/content_nav_bullet.jpg);


      }



Upon rollover of the text in Subnav, it should show a custom bullet to the left.
It works fine in IE6 but not in Mozilla Firefox.

Any ideas please?
tinglewebAsked:
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.

php-webdesignCommented:
you can try:

ul#mainnav, ul.subnav, li a:hover {
     color:#167B9F;
     list-style-image: url(images/content_nav_bullet.jpg);
}

and does the color change or not??
0
tinglewebAuthor Commented:
The code in the CSS is actually as follows (yes, the colour changes if I change the hover colour in CSS):

      ul#mainnav {
      margin: 0px;
      padding: 0px;
      color:#167B9F;
      list-style: none;

      }
            
ul#mainnav li {
      display: block;
      border-top: 1px solid #FFFFFF;
      color:#167B9F;

      }

ul#mainnav li a {
      display: block;
      margin: 0px 0px 0px 0px;
      text-decoration: none;
      width: 88%;
      color:#167B9F;

      }


      
ul#mainnav ul.subnav {
      margin: 0px 0px 0px 10px;
      padding: 0px;
      color:#167B9F;
      list-style: none;

      
      }

ul#mainnav ul.subnav li {
      border-top: 0 none;
      color:#167B9F;
      font-weight: bold;
      line-height: 210%;
      font-size: 0.995em;
      }

ul#mainnav ul.subnav li a {
      margin: 0px;
      color:#167B9F;
      
      }

ul#mainnav, ul.subnav, li a:hover {
     color:#167B9F;
     list-style-image: url(images/content_nav_bullet.jpg);
}
0
php-webdesignCommented:
strange...

W3C CSS Validator Results for file://localhost/test.css
No error or warning found

To work as intended, your CSS style sheet needs a correct document parse tree. This means you should use valid HTML.

are you using the right doctype??

http://validator.w3.org/
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.

tinglewebAuthor Commented:
Can you use the validator with CSS files?
0
tinglewebAuthor Commented:
It works fine in IE, by the way...
0
php-webdesignCommented:
on w3c.org there is a CSS validator :)

let me look for a mozilla bug or something
0
php-webdesignCommented:
i can only find problems with this issue for IE:

http://www.experts-exchange.com/Web/Web_Languages/CSS/Q_21175675.html

but maybe it helps you
0
seanpowellCommented:
Tingleweb,

Your containing ul has this declaration:

ul#mainnav ul.subnav
{
     list-style: none;
}

so you can't have a list style image without a list style.

Use this instead:

ul#mainnav ul.subnav li a:hover
{
      color:#167B9F;
      background: url(images/content_nav_bullet.jpg) no-repeat 4px 12px;
}


and you need to remove the commas from this rule:
ul#mainnav, ul.subnav, li a:hover

Thanks,
Sean
0
mreuringCommented:
Based on Sean's solution, you might also want to create a bit of spacing to place the bullet in front of the link:

ul#mainnav ul.subnav li a:hover
{
     color:#167B9F;
     background: url(images/content_nav_bullet.jpg) no-repeat 4px 12px;
     margin-left: -15px;
     padding-left: 15px;
}

Oh and even if a list-style was valid, mozilla would likely have rendered quite differently from IE as the 'a'-tag is targetted on hover and not the 'li'. I realise that this was done for IE's sake, but you should realise the impact.

Just thought I'd mention it :)

  Martin
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
tinglewebAuthor Commented:
The background tag doesnt give the same desired effect as list-style-image does in IE.

I dont understand why the list-style-image doesnt work in Mozilla in my case - it should.

Is there any more info I could provide that would help you spot whats causing it not to work?

Your help is very much appreciated

- alicia
0
seanpowellCommented:
It's not working because it's not supposed to...

<a> tags do not have a value of list-style-image.

IE displays the image on hover, but that browser would probably spin your monitor around if you added screen-type:upside-down. (Although I'm afraid to test that last one...)

This:
background: url(images/content_nav_bullet.jpg) no-repeat 4px 12px;

gives you much better control over where the bullet appears cross-browser, and is syntactically correct as there's nothing wrong with adding a background to the <a> tag. If you are getting strange results with this, it's just some of the other settings that you are using that's throwing it off.

Sean
0
tinglewebAuthor Commented:
Well done guys!!

I tweaked the margin/padding and yes it works lovely

Thank you for all your help Sean & Martin

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.