Results 1 to 3 of 3

Thread: How to use List in XHTML

  1. #1
    Join Date
    Aug 2008
    Posts
    30

    How to use List in XHTML

    The lists are almost always present with the new sites coded in XHTML strict. Indeed, they are often used to create menus. You do not perhaps aware, but the menu you see on the left of this site is a list, decorated with CSS. Do not be put off if you also talk about menus in this chapter, you will see that it is better to create menus with lists that using <br /> to skip lines. The lists can be better understood by those who use special browsers, and the record is identical to the graphical browsers. You have nothing to be afraid to use them. We will now see what are the three types of lists available:

    The bulleted lists unordered: these lists are the smart base.
    The bulleted lists ordered the chips have a number and are ordered.
    The list of definitions: they do not have fleas, but will allow you to classify information more easily. We will see why a little lower.


    The bulleted lists Unordered

    The bulleted lists are not ordered primarily used in websites. Here is an example of a bulleted list (not formatting):

    • Element 1
    • Element 2
    • Element 3


    Code:
    <Ul> 
    <Li> Element 1 </ li> 
    <Li> Element 2 </ li> 
    <Li> Element 3 </ li> 
    </ Ul>
    The number of items you can make is unlimited. Here is the XHTML code for the example above:

    As you can see, we start the list by tag <ul> each element is surrounded by tags <li>, and then closes the list with </ ul>. Note that you can not save as text or tags outside <li> tags. I do not want to see this:

    Code:
    <Ul> 
    <Strong> <li> Element 1 </ li> </ strong> 
    <Li> Element 2 </ li> 
    <Li> Element 3 </ li> 
    </ Ul>
    Neither this:

    Code:
    <Ul> 
    Title of my list 
    <Li> Element 1 </ li> </ strong> 
    <Li> Element 2 </ li> 
    <Li> Element 3 </ li> 
    </ Ul>

  2. #2
    Join Date
    Aug 2008
    Posts
    30

    Re: How to use List in XHTML

    It differs from the previous by the fact that adds numbers to the bullets. So there is a notion of order, not necessarily binding in the facts that you listed, but useful when you describe the steps. This list differs from the previous one only by the fact that this time you use the <ol> and no <ul> to begin the list. The elements will always be realized by tags <li>.

    Here's an example:

    Code:
    <P> Remove the cap from the end of the USB Stick. </ p> 
    <Ol> 
    <Li> Pull out the SIM card holder from its slot and insert the SIM </ li> 
    <Li> Re- insert the SIM card holder into the USB Stick.  </ li> 
    <Li> TPlug the USB Stick into your computer's USB port - make sure the USB Stick is fully inserted </ li> 
    <Li> Now connect to laptop and access internet </ li> 
    </ Ol>
    And here's what happens:

    1. Remove the cap from the end of the USB Stick.
    2. Pull out the SIM card holder from its slot and insert the SIM
    3. Re- insert the SIM card holder into the USB Stick.
    4. TPlug the USB Stick into your computer's USB port - make sure the USB Stick is fully inserted
    5. Now connect to laptop and access internet


    You see, this is not complicated, at least not yet.

  3. #3
    Join Date
    Aug 2008
    Posts
    30

    Re: How to use List in XHTML

    Definition lists

    As their name suggests, lists of definitions are mainly used to list words and their associated definitions. They may have other uses thanks to CSS, and it is possible to use in menus. There are some elements that change from the two other lists that we have just seen:

    First, to start a list of definitions, we use the tag <dl>. Then, to say that we will define a word, use the tag <dt>. Finally making the definitions of the word, use the tag <dd>. Here is an example that will help you better understand:

    <Dl>
    <Dt> Body </ dt>
    <Dd> Definition 1 </ dd>
    <Dd> Definition 2 </ dd>
    <Dt> computer information </ dt>
    <Dd> computer Motherboard </ dd>
    </ Dl>

    And here's what happens:

    Definition 1
    Definition 2
    computer information
    computer Motherboard

Similar Threads

  1. JKsf and xhtml
    By Sargam in forum Software Development
    Replies: 5
    Last Post: 23-07-2010, 06:09 AM
  2. Don't know about the advantages of XHTML
    By Sarfaraj Khan in forum Software Development
    Replies: 5
    Last Post: 30-01-2010, 01:43 PM
  3. How to Host an XHTML Website with a FTP?
    By hatred in forum Software Development
    Replies: 5
    Last Post: 06-01-2010, 07:49 PM
  4. Is XML, DHTML, and XHTML are all the same thing?
    By Mentos in forum Software Development
    Replies: 3
    Last Post: 12-09-2009, 01:13 PM
  5. Differences between XHTML and PHP
    By JTD in forum Software Development
    Replies: 1
    Last Post: 22-11-2008, 02:42 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,623,532.58695 seconds with 17 queries