views:

1297

answers:

6

I've got a stylesheet that will not, for whatever reason, apply list-style-type to a UL element. I'm using YUI's Grid CSS with their reset-fonts-grid.css file, which I know strips that out as part of the CSS reset.

After calling YUI, I call the stylesheet for the website and in there have a block for UL:

ul {list-style-type: disc;}

I've also tried setting it via list-style but get the same result. I know that the above CSS block is getting read as if I add things like padding or margins those do get applied. The style-type isn't showing up in either Firefox or IE.

The only other CSS I've applied to UL's are in a #nav div but that CSS doesn't touch the list-style-type, it uses the reset that YUI provided, and YUI and the site style sheet are the only two CSS sheets that are called.

I've also got FCKEditor on the admin side of the site and that editor does show the bullet styles so I know it has to be something with the CSS that isn't being filtered by FCKEditor.

A: 
  • Have you tried following the rule with !important?
  • Which stylesheet does FireBug show having last control over the element?
  • Is this live somewhere to be viewed by others?

Update

I'm fairly confident that providing code-examples would help you receive a solution must faster. If you can upload an example of this issue somewhere, or provide the markup so we can test it on our localhosts, you'll have a better chance of getting some valuable input.

The problem with questions is that they lead others to believe the person asking the question has sufficient knowledge to ask the question. In programming that isn't always the case. There may have been something you missed, or accidentally jipped. Without others having eyes on your code, they have to assume you missed nothing, and overlooked nothing.

Jonathan Sampson
Firebug helped me find what CSS was stripping it, thanks!
dragonmantank
A: 

All I can think of is that something is over-riding this afterwards.

You are including the reset styles first, right?

dylanfm
+4  A: 

If I'm not mistaken, you should be applying this rule to the li, not the ul.

ul li {list-style-type: disc;}
steve_c
You are mistaken. It is to be applied to the ul. http://www.w3.org/TR/CSS21/generate.html#list-style
However, it looks like browsers will allow you to do this
dragonmantank
A: 

Turns out that YUI's reset CSS strips the list style from 'ul li' instead of just 'ul', which is why setting it just in 'ul' never worked.

dragonmantank
which is why I find stripping it from 'ul li' or 'li' in the first place to be very unnecessary - especially from a framework or reset. Setting 'list-style' strictly at the OL/UL level has worked well for me
Andy Ford
A: 

You need to include the following in your css:

li { display: list-item; }

This triggers Firefox to show the disc.

A: 

and you can also give a left-margin if the reset.css you are using make all margin null : that means :

li {
list-style: disc outside none;
display: list-item;
margin-left: 1em;
}

Assuming you apply this css after the reset, it should work !

Matthieu Ricaud