Submodule 2.1: Comments and Lists
Site: | HUB de Montée en Compétences - CYRITECH C.S.L |
Course: | HTML |
Book: | Submodule 2.1: Comments and Lists |
Printed by: | Visiteur anonyme |
Date: | Saturday, 23 November 2024, 5:59 PM |
Description
- Comments
- Unordered list
- Ordered list
- Nested list
Comments
Comments are used in HTML when we want to remind ourselves something or we want to explain to others what we did.
Comments are not visible on the page.
The comment tag starts with <!--
and ends with -->
.
Lists
In HTML there are two types of lists <ul>
and <ol
.
<ul>
stands for unordered list, which is the classical list with bullet points.
<ol>
stands for ordered list in which its items are marked with numbers.
Each item of both lists starts with <li>
tag, which stands for list item, and ends with </li>
.
By default a <ol>
will start counting from 1.
However, we are able to change the start point, reverse the counting or even use alphabetical characters.
Examples
Unordered list
- The first item
- The second item...
- The third item!
Ordered list
- The 1st item
- The 2nd item...
- The 3rd item!
- The 4th item!
This ordered list starts from 2000
- the 1st year of the 21st century
- the 2nd year of the 21st century
- the 3rd year of the 21st century
- the 4th year of the 21st century
This ordered list is reversed
- the last year of 21st century
- two years until the end of the 21st century
- three years until the end of the 21st century
- four years until the end of the 21st century
Nested list
- Coffee
- Tea
- Black tea
- Green tea
- Milk
You can find more examples of Lists on w3schools
Exercise
- Open your editor, create a new file and save it as
exersice02.1.02.html
in the folder "Exercises" - Modify the file. The browser's output should be as shown in the following image: