Click to See Complete Forum and Search --> : [RESOLVED] list-style-type
sitehatchery
07-03-2006, 09:13 AM
I'd like the ordered list to have a list-style-type to look like this:
1) bla bla
2) bla bla
...
Something like: list-style-type:paren ... but of course, this doesn't work. Anybody know how to go about this?
dthurman1432
07-03-2006, 10:01 AM
ol { list-style-position: outside; }
sitehatchery
07-03-2006, 10:12 AM
It's outside by default. What I'm looking for is the ")" after the number and not the "."
dthurman1432
07-03-2006, 10:24 AM
Sorry, I can't seem to find anything that will set the parentheses.
sitehatchery
07-03-2006, 10:29 AM
I wasn't able to find it either. Is there any way to take of the "." after the number?
Kravvitz
07-03-2006, 08:38 PM
You have to add the markers to the list-item manually or use a server-side language to do it.
Or in this case because it's stylistic, you could do it with JavaScript and just remember that people using a browser without JavaScript support enabled would see "1." instead of "1)".
NogDog
07-03-2006, 09:50 PM
Theoretically you could use the :before pseudo-element along with the content and counter properties, but of course IE6 does not support the :before pseudo-element. :(
This works fine in Firefox, though:
CSS:
#parens {
counter-reset: parens;
list-style: none;
padding: 0;
margin-left: 0;
}
#parens li:before {
content: counter(parens)") ";
counter-increment: parens;
}
HTML:
<ol id="parens">
<li>Item one</li>
<li>Item number 2</li>
<li>Item no. three</li>
</ol>
sitehatchery
08-09-2006, 02:50 PM
I just showed it manually with breaks.
1) item 1 <br>
2) item 2 <br>
...
Not the result I wanted, but oh well.