HTML nested lists ol and ul tags

by top54u.com 06 Jul, 2008
Spotlight.....

HTML list tags such as ol and ul can be used nested within each other to display some hierarchal composition of web page content with ordered as well as unordered list of points. You can create a nested unordered HTML ul list with bullets inside the ordered HTML ol list. You can place the code assembly of ul tag along with its list items enclosed on HTML li tags inside the list item HTML li tag of outer HTML ol tag.

 

Example of nested HTML lists ol and ul tags

 

<ol type="1">

<li>Main ordered List item 1</li>

<li>

Below is an example of HTML nested unordered list with bullets

<ul type="disc">

<li>nested list item 1</li>

<li>nested list item 2</li>

<li>

Sub nested ordered list

<ol type="a">

<li>sub nested list item 1</li>

<li>sub nested list item 2</li>

</ol>

</li>

</ul>

</li>

</ol>

 

Output:

  1. Main ordered List item 1

  2. Below is an example of HTML nested unordered list with bullets

    • nested list item 1

    • nested list item 2

    • Sub nested ordered list

      1. sub nested list item 1

      2. sub nested list item 2

 

Spotlight.....

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , , , , , , , , ,

Comments

7/19/2008 3:27:48 PM

Xtopher

This doesn't validate in Dreamweaver.
"The tag <ul> is not allowed within <ol>

Xtopher us

7/19/2008 3:44:20 PM

top54u.com

Hi Xtopher

I think you are placing the <ul> tag outside the <li></li> list item tag of parent <ol> ordered list.
You have to place the <ul> of nested unordered list within the <li> and </li> tags of <ol> as shown in the sample code above in order to validate its markup in Dreamweaver.

Good Luck

top54u.com us

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

8/23/2008 8:48:41 PM

OUR SPONSORS[+ advertise here]
related videos.....
recent posts.....
top54u ezines.....