|
|||||||
| HTML Discussion and technical support for building, using and deploying HTML sites. |
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Need help making an <ol> list count backwards
Ok so ive seen the use of start=""
I entered the starting number i want it to count backwards from 5 and it counts upwards from 5 I read put a - sign before the number so i did and yay now it counts backwards BUT the numbers have the - sign before them So how do i manipulate a <ol> list to make it count down from 5 without any - signs displayed So it would look like 5. Some info here 4. Some info here 3. Some info here 2. Some info here 1. Some info here As opposed to -5. Some info here -4. Some info here -3. Some info here -2. Some info here -1. Some info here Can anyone advise me how this works, im sure its something simple but ive searched the net and this site and cant find anything |
|
#2
|
|||
|
|||
|
#3
|
||||
|
||||
|
thanks but that wasnt any use really as it did not answer my question
|
|
#4
|
||||
|
||||
|
Well if that didn't answer your question then what is your question? The threads on that forum entry cover all of the current and future ways of reversing the numbers on the front of an ordered list.
__________________
Stephen |
|
#5
|
||||
|
||||
|
I merely glanced at the URL thread provided: it looks to me to be merely hard-coding the number of links in descending order (10, 9, 8, 7, etc.).
This might prove unweildy if you have many <li>s and later, have to add many more... Thinking how an "<ul>" or also a "<ol>" operates (standard ltr, or 'left-to-right'), -one could reverse this to read "rtl" (right-to-left) so "1" is "float:right;" and #2 is also "float:right" but it lands to the immediate LEFT of "#1", and so forth... This could be coded something like Quote:
And with this, the default "display:block;" means counting vertically-bottom-to-top, and change that to "display:inline;" means counting horizontally-right-to-left... Quote:
Quote:
__________________
Help Save Ana My Portal: I Build WebPagesPricing? Read:http://www.webdeveloper.com/forum/pricing_faq.html AUP: http://www.jupitermedia.com/corporate/privacy/aup.html I test with: Firefox, Mozilla, Opera, Safari-on-XP, Google Chrome, SeaMonkey Internet.com freelancers Last edited by WebJoel; 01-15-2008 at 09:17 AM. |
|
#6
|
|||
|
|||
|
Here's an alternate method using javascript. You can initially set the list numbering style to "none", set each li value, then reset the list numbering style so it is visible again.
In code: Code:
<head>
<style type="text/css">
#reverse { list-style-type: none }
...
</style>
</head>
<body>
...
<ol id="reverse">
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
<script type="text/javascript">
<!--
var ol = document.getElementById("reverse");
var lis = ol.getElementsByTagName("li");
for (var i = 1; i <= lis.length; i++)
lis[lis.length-i].value = i;
ol.style.listStyleType = "decimal";
//-->
</script>
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|