Remove period for ordered-list numbers?

admin

Administrator
Staff member
I can't see how to do this, but it must be easy.

According to the reference (<!-- m --><a class="postlink" href="http://www.w3schools.com/css/pr_list-style-type.asp">http://www.w3schools.com/css/pr_list-style-type.asp</a><!-- m -->), if you use a number, it's got to have a trailing period.

Any way to get around this?

I mean, obviously I can just "list-style:none"--it, and then generate a number inside the <li>-tags, but that's kind of ugly.Only by adding the numbers yourself with the DOM, as you suggest.
There is a method of doing this in css2, but only Opera supports counter (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-CSS2/generate.html">http://www.w3.org/TR/REC-CSS2/generate.html</a><!-- m -->)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>counter</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
ul {
list-style-type:none;
}
ul li:before {
content:counter(number) " ";
counter-increment:number;
}
-->
</style>

</head>
<body>
<ul>
<li>apple</li>
<li>banana</li>
<li>cranberry</li>
</ul>
</body>
</html>Only by adding the numbers yourself with the DOM, as you suggest.
There is a method of doing this in css2, but only Opera supports counter (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-CSS2/generate.html">http://www.w3.org/TR/REC-CSS2/generate.html</a><!-- m -->)

Right, thanks.
 
Back
Top