Lists In HTML

Lists In HTML

In this article we'll be learning about list and Forms. Let's Start with Lists, there are two types of lists in HTML

  1. Ordered List

  2. Unordered List

Ordered List

Ordered lists are those where order matters for e.g. we are listing down the ranks of students so we cannot shuffle them. Ordered list provides us the numbers. Let's see the example.


    <h3>Rank Of students</h3>
    <ol>
        <li>Bharat</li>
        <li>Nobita</li>
        <li>Suneo</li>
        <li>Doraemon</li>
        <li>Dekisuki</li>
    </ol>

As we can see , here we cannot write "Nobita" at position 1 because 1st rank secured by Bharat and so on.

Unordered List

Unordered Lists are those where orders doesn't matters e.g. we are listing down the name of movies. Unordered List provides us bullets instead of serial no. because here no need to write in order.

 <h3>Movies</h3>

    <ul>
        <li>The Family Man</li>
        <li>Stranger Things</li>
        <li>The Boys</li>
        <li>Death Note</li>
    </ul>

As we can see, we use unordered list where our content doesn't depend on order. Note:- we can change our serial no. and bullets by using attributes in ordered and unordered list respectively e.g.

<ul type="circle">
        <li>ABC</li>
        <li>def</li>
        <li>ghi</li>
        <li>jkl</li>
    </ul>

Here we can see, How I changed my bullets into circle by using "type" attribute. I would suggest you go and try all the attributes by yourself.

Conclusion

As I believe, to be a good developer we should more focus on practicality, not on theory. so go and get your hands dirty on it, try all the code by yourself.

Thank you so much for reading it completely, If you liked it do like, comment, share and follow for more content. Comment for any feedback.