window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XQHM40L9F7');

HTML Basics


Go to main Page

HTML Basics

  1. Document Starts with <!DOCTYPE html>
  2. Then there is a root tag <html>   with opening and closing both.
  3. Then there is a title tag <title>   with opening and closing both.
  4. Then there is a body tag <body>   with opening and closing both, and Your visible part should be in body tag

<!DOCTYPE html>
<html>
<head>
<title>Tiltle of Page here</title>
</head>
<body>

<h1>Heading Here</h1>
<p>ParagraphHere!</p>

</body>
</html> 


HTML Headings

HTML has 6 headings <h1> to <h6>

<h1> represents most important heading and it has large size than other headings.<h6> represnents least important heading.And <h2>,<h3>,<h4>,,<h5> are in between ,<h1> and ,<h6>.You can use all headings or any of one you need.

Example

<!DOCTYPE html>
<html>
<head>
<title>Tiltle of Page here</title>
</head>
<body>

<h1>Heading Here</h1>
<h2>Heading Here</h2>
<h3>Heading Here</h3>
<h4>Heading Here</h4>
<h5>Heading Here</h5>
<h6>Heading Here</h6>

</body>
</html> 


HTML Paragraphs

For paragraph in HTML Document we use <p>content</p>

Example

<!DOCTYPE html>
<html>
<head>
<title>Tiltle of Page here</title>
</head>
<body>

<p>First paragraph here</p>
<p>This is another paragraph we are writing a paragraph</p>


</body>
</html> 


HTML Links

For Links in HTML Document we use <a> </a>

Example

<!DOCTYPE html>
<html>
<head>
<title>Tiltle of Page here</title>
</head>
<body>

<a href="demo.com">Click here</a>
<br>
<a href="demo.com">Next Page</a>


</body>
</html> 


HTML Images

For image in HTML Document we use <img> .It does not have closing tag.

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <title</title>
</head>
<body>
    <img src="https://cdn.pixabay.com/photo/2021/02/02/18/46/city-5974876__340.jpg" width="300px">
    
</body>
</html>