Skip to main content

Lists, Ordered List,ul,TUTE-7

                                                                  Lists



HTML offers three ways for specifying lists: ordered lists,
 unordered lists, and description lists. Ordered lists use ordinal sequences to indicate the order of list elements,
 unordered lists use a defined symbol such as a bullet to list elements in no designated order, and description lists use indents to list elements with their children. 
This topic explains the implementation and combination of these lists in HTML markup.

 Ordered List

An ordered list can be created with the <ol> tag and each list item can be created with the <li> tag as in the example below:

<ol>  
<li>Item</li> 
 <li>Another Item</li>
  <li>Yet Another Item</li>
 </ol>

This will produce a numbered list (which is the default style):
Item1. Another Item2. Yet Another Item3.

Manually changing the numbers
There are a couple of ways you can play with which numbers appear on the list items in an ordered list. The first way is to set a starting number, using the start attribute. The list will start at this defined number, and continue incrementing by one as usual.

<ol start="3">  
<li>Item</li>  
<li>Some Other Item</li> 
 <li>Yet Another Item</li> 
</ol>

This will produce a numbered list (which is the default style):
Item3. Some Other Item4. Yet Another Item5.
You can also explicitly set a certain list item to a specific number. Further list items after one with a specified value will continue incrementing by one from that list item's value, ignoring where the parent list was at.

<li value="7"></li>

It is also worth noting that, by using the value attribute directly on a list item, you can override an ordered list's existing numbering system by restarting the numbering at a lower value. So if the parent list was already up to value 7, and encountered a list item at value 4, then that list item would still 
from that point again.

<ol start="5">
  <li>Item</li>  
<li>Some Other Item</li> 
 <li value="4">A Reset Item</li> 
 <li>Another Item</li>
  <li>Yet Another Item</li> 
</ol>

So the example above will produce a list that follows the numbering pattern of 5, 6, 4, 5, 6 - starting again at a number lower than the previous and duplicating the number 6 in the list.
Note: The start and value attributes only accept a number - even if the ordered list is set to display as Roman numerals or letters.
Version ≥ 5

You can reverse the numbering by adding reversed in your ol element:
<ol reversed> 
 <li>Item</li>  
<li>Some Other Item</li>  
<li value="4">A Reset Item</li> 
 <li>Another Item</li> 
 <li>Yet Another Item</li> 
</ol>
Reverse numbering is helpful if you're continually adding to a list, such as with new podcast episodes or presentations, and you want the most recent items to appear first.

Comments

Popular posts from this blog

short key of c programming

short key of c programming Shortcut Keys(Hot Keys)     Operation    Alt + F  -            Open file Alt + F3 -           Close Alt + F + N  -    New file Alt + X  -           Exit turbo c Alt + F5 -          Output Screen Alt + F + L  -    Check programme load or not. Alt + ENTER  - Full screen Shift + Del -       Cut Shift + Insert -   Paste Ctr + Insert -    Copy Alt+F9 -           Compile a program Ctr + F8           Bbreak point Ctrl+F9 -          To run a program Ctrl+s -...

C LANGUAGE - OVERVIEW C - VARIABLES

C LANGUAGE - OVERVIEW Advertisements C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC PDP-11 computer in 1972. In 1978, Brian Kernighan and Dennis Ritchie produced the first publicly available description of C, now known as the K&R standard. The UNIX operating system, the C compiler, and essentially all UNIX application programs have been written in C. C has now become a widely used professional language for various reasons − Easy to learn Structured language It produces efficient programs It can handle low-level activities It can be compiled on a variety of computer platforms Facts about C C was invented to write an operating system called UNIX. C is a successor of B language which was introduced around the early 1970s. The language was formalized in 1988 by the American National Standard Institute  A N S I A N S ...

environment

It looks like you meant "environment." The environment refers to the surroundings or conditions in which a person, animal, or plant lives or operates. It encompasses various elements, including natural resources, ecosystems, climate, and human-made structures. Protecting and preserving the environment is crucial for the well-being of all living organisms on Earth. Is there anything specific you'd like to discuss or learn about regarding the environment?