Welcome to the 2nd day of my 100 days web development challenge. So, basically this is my day 2 of learning HTML. Yesterday, I started this challenge by learning some basics about the HTML language and it's syntax. It was not very hard to understand the syntax, actually it's syntax is way easier than many other languages out there. I wrote a "Hello World" program using HTML and tried to explain the whole 10 to 11 lines of code in the last blog. You can check the blog and if you want to see the code it is available on my GitHub.
So, today I proceeded with the of tag in HTML and implemented them. They are given below.
Topics:
HTML Headings:
- Headings are used to display some title or a heading in a web page.
- Headings indicate the starting of a new topic or some important text.
- They are important as it helps the browser to search the content of a web page with the name of the heading.
- There are total 6 heading tags in HTML, they are as follows:
- <h1>
- <h2>
- <h3>
- <h4>
- <h5>
- <h6>
- All the heading tag have an opening tag and a closing tag.
- The <h1> tag is the most important tag and displays the text in the largest size.
- The <h1> tag is followed by <h2> tag which is the second most important tag and it displays the text slightly smaller than <h1> tag.
- Then comes the <h3> tag which is again smaller than <h2> tag and then this goes on till <h6> tag.
How to use heading tags?
--> Below is an example for writing heading tags.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Headings</title>
</head>
<body>
<h1>This is Heading 1</h1>
<h2>This is Heading 2</h2>
<h3>This is Heading 3</h3>
<h4>This is Heading 4</h4>
<h5>This is Heading 5</h5>
<h6>This is Heading 6</h6>
</body>
</html>
HTML Lists:
- Lists are used to display a set of items related to each other.
- There are mainly 2 types of lists in HTML and they are: Ordered list and Unordered list.
- Both Ordered list and Unordered list have an opening tag and a closing tag.
Ordered list:
An Ordered list displays a set of lists with an ascending number or character. For example, an Ordered list starts with 1 by default.
Ordered list is defined by <ol> tag and the lists inside <ol> tag starts with <li> tag which defines the set of list items.
<p>Ordered list</p>
<ol>
<li>iPhone</li>
<li>Oppo</li>
<li>Vivo</li>
<li>OnePlus</li>
</ol>
Unordered list:
An Unordered list displays bulleted list instead of numbered list.
Unordered list is defined by <ul> tag and the lists inside <ul> tag starts with <li> tag which defines the set of list items.
<p>Unordered list</p>
<ul>
<li>Java</li>
<li>Python</li>
<li>PHP</li>
<li>JavaScript</li>
</ul>
Comments
Post a Comment
If you have any doubts, Please let me know.