Basic HTML syntax and structure

From our previous tutorial, we already know that HTML is the standard markup language used to create web pages. If you missed the previous tutorial please click here to study that first before moving to this one.

HTML is made up of a series of elements that are used to describe the structure and content of a web page.

The basic structure of an HTML document includes a <head> element and a <body> element. The <head> element contains information about the page, such as its title and any linked resources, such as CSS stylesheets or JavaScript files. The <body> element contains the actual content of the page, such as text, images, and videos.

A basic HTML page has a simple structure, which looks something like this:

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>
  <h1>This is a heading</h1>
  <p>This is a paragraph.</p>
</body>
</html>

The <!DOCTYPE html> declaration at the top of the page tells the web browser that this is an HTML page.

The <html> element is the root element of the page, and it contains all of the other elements.

The <head> element contains information about the page, such as the page title, which is specified in the <title> element.

The <body> element contains the content of the page, such as headings, paragraphs, and other elements.

HTML Element

HTML elements are the building blocks of a website. They are used to structure and format the content on a web page, and can be distinguished by their tags. The tag is the element’s name enclosed in angle brackets, and it is used to identify the element and its content.

For example, the <p> tag is used to create a paragraph element, and the <h1> tag is used to create a heading element. Here is an example of how you might use these tags in an HTML document:

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

In this example, the <h1> tag is used to create a top-level heading, and the <p> tag is used to create a paragraph.

You can also use attributes to provide additional information about an element. For example, the href attribute is used to specify the destination of a link, and the src attribute is used to specify the source of an image. Here is an example of how you might use these attributes:

<a href="https://www.example.com">This is a link</a>
<img src="image.jpg" alt="This is an image">

In this example, the href attribute is used to specify the destination of the link, and the src attribute is used to specify the source of the image. The alt attribute is also used to provide a text description of the image for users who are unable to view it.

There are many other HTML elements and attributes that you can use to create a well-structured and well-formatted website. To learn more about HTML, I would recommend starting with a basic tutorial or reference guide. There are many resources available online that can help you further such as HTML official website and w3schools. For further questions, please leave a comment below. Shallout!!!