HTML Headings

HTML heading is defined with <h1> to <h6> tag.

The most important heading is <h1> and <h6> is the least important heading.

Try Now


   <!DOCTYPE HTML>
   <HTML>
   <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 Paragraphs

HTML paragraph is defined with the <p> tag. 

Try Now


<!DOCTYPE html>
<html>
<body> <p> Paragraph Section </p> <p> Another Paragraph Section.</p> </body>
</html>

HTML Links

In HTML link are defined with the <a> tag. You have to put the path of the link inside href. The href is an attribute. Attributes tell us additional information about HTML. We will learn more about attributes in a later chapter.

Try Now


<!DOCTYPE html>
<html>
<body>
     <a href="https://agyanadda.com/">This is a link</a>
</body>
</html>

HTML Images

In HTML images are defined with <img> tag. 

Try Now


<!DOCTYPE html>
<html>
<body>
<img src="asset/img/how-to-do-agyanadda.jpg " alt="agyanadda.jpg" width="100" height="100">
</body>
</html>

In the given above example the source file (src), alternative text (alt ), width and height are also attributes.

Note:  The alt tag is helpful when the image is not found then the alt tag name is shown in the browser. If the image is found then the alt tag name is not shown in the browser.

HTML Line Break In HTML the line break tag is used for the next line or break new line. It is an empty element that means there is no need to open and close the tag.

 Example

Try Now


<!DOCTYPE html>
<html>
<head>
<title>Line Break Example</title>
</head>
<body>
<p>Hello Hi<br/> I am Learning HTML<br/> Thanku so much</p>
</body>
</html>

Horizontal Lines

In HTML the horizontal line tag <hr> is used to break-up the section of the document. It creates a line from the current position.

Example

Try Now

<!DOCTYPE html>
<html>
<head> 
  <title>Line Break Example</title>
</head>
<body>   
<p>Hello Hi</p>   
<hr> 
<p>I am Learning HTML Thank you so much</p>
</body>
</html>

How to view HTML Source code?

It is an interesting thing when you run your HTML code then you can see the result in the browser but if you want to see the source code of HTML then just right-click and go to the inspect option you can see the source code.

You can also edit your HTML code and see their result in the browser.

It is very important to inspect HTML code. When you create a project then it will help you so much.

There are many tags we will learn in the next chapter.


Prev Next