ordered lists

liunx

Guest
in html when using the ordered list tag <ol>, is it possible to make <li> appearing as decimal numbers such as 1.1, 1.2 ?<br />
<br />
Code:<br />
<ol><br />
<li>I want this to be 1</li><br />
<ol><br />
<li> I want this to be 1.1 not 2</li><br />
</ol><br />
</ol><br />
Thanks!<!--content-->Not yet, you will have to enter them yourself or with JavaScript using the DOM.<br />
In Opera you can do it using counter:<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"<br />
"http://www.w3.org/TR/html4/strict.dtd"><br />
<html lang="en"><br />
<head><br />
<title>counter</title><br />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><br />
<style type="text/css"><br />
<!-- <br />
h1:before {<br />
content:counter(chapter) ".";<br />
counter-reset:section;<br />
counter-increment:chapter;<br />
} <br />
h2:before {<br />
content:counter(chapter) "." counter(section);<br />
counter-reset:subsection;<br />
counter-increment:section;<br />
} <br />
--><br />
</style><br />
</head><br />
<body><br />
<h1>chapter</h1><br />
<h2>section</h2><br />
<h2>section</h2><br />
<h2>section</h2><br />
</body><br />
</html><!--content-->
 
Back
Top