MakeW3web

HTML fundamentals

Basically html have their own basic syntax and format which all webpages contains. let's understand the basic of html syntax one by one.

Here is the getting started code of HTML.

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Title of the document</title>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

<!DOCTYPE html>  Each HTML document begins with a <!DOCTYPE html> tag, which indicates the version of HTML used. Also, no closing tag is required. You can also call it the first tag of every HTML document.

<HTML>  The HTML tag starts the HTML document and contains everything in the entire document except the <!DOCTYPE html> tag. Closing tag is optional you can use it or not it is up to you. However, we always recommend you to use closing tags for this.

This is the first and last tag of the HTML document/webpage. Everything else in an HTML webpage goes between those two tags and is basically part of the HTML element. here is the example that we already saw earlier.

<html>
  <body>
    <h1>My First Code with Makew3web</h1>
    <p>My first paragraph.</p>
  </body>
</html>

<HEAD>  Head tag contains the head of an HTML document, which includes all the basic information of the webpage i.e. the title of the webpage. It includes some basic features like style and title.

Head tag also contains other tags <title>, <meta>, <link>, <style> <link>, keywords for search engine, base address for URLs and more.

<head>
  <title>Title of the document</title>
</head>

<Title> The title tag contains the title of the webpage, which will appear in the title bar section of the web browser. Also used by search engines to refer to the document. Each <HEAD> tag includes a <Title> tag element.

You can see below code and result in which title text is appearing in title bar section of browser

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Title of the document</title>
</head>

<Body>  The body tag contains the body of the HTML document. Which includes the content that is actually visible in the web browser or in other words you can say that the content of the webpage is placed in the page's <body> element.

You can check the below example for better understanding.

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Title of the document</title>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>
Was this page helpful?