HTML Documents
- All HTML documents must start with a document type declaration: <!DOCTYPE html>.
- The HTML document itself begins with <html> and ends with </html>.
- The visible part of the HTML document is between <body> and </body>.
Example
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph</p>
</body>
</html>
Try it »
HTML Headings
- HTML defines six levels of headings.
- HTML headings are defined with the <h1> to <h6> tags.
- <h1> defines the most important heading and <h6> defines the least important heading.
Example
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h4>This is a heading</h4>
<h5>This is a heading</h5>
<h6>This is a heading</h6>
</body>
</html>
Try it »
HTML Paragraph
- HTML paragraphs are defined with the <p> tag.
- <p> tag is used to write the paragraph statements in a webpage.
Example
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p>This is the first paragraph</p>
<p>This is the second paragraph</p>
</body>
</html>
Try it »
HTML Horizontal Line
- The <hr> tag is used to break the page.
- <hr> tag is an empty tag.
- <hr> tag creates a horizontal line running from the left ot the right.
Example
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is the heading</h1>
<p>This is the first paragraph</p>
<p>This is the second paragraph</p>
<hr>
<p>This is the first paragraph</p>
<p>This is the second paragraph</p>
</body>
</html>
Try it »
HTML Links
Example
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h2>How to add a link in HTML</h2>
<p>Click on the following link:</p>
<p>This is the second paragraph</p>
<a href="https://www.codersarts.com/">Coders Arts</p>
</body>
</html>
Try it »
HTML Buttons
Example
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h2>HTML Buttons</h2>
<p>HTML buttons are defined with the button tag:</p>
<button>Click Here</button>
</body>
</html>
Try it »