MakeW3web

HTML tags and elements

Tags & Elements

HTML has its own pre-defined tags that help the browser to separate HTML code from all other text. All tags have their own properties that differentiate between ordinary text. Collectively starting tags, ending tags, and everything in between them make the HTML elements. You can check the basic structure of the HTML elements in the image below.

<Opening tag>----'your content'---- </Closing tag>

Let's understand it with some basic examples.

In the below example all elements contain opening and closing tags. using those tags we have created the basic section. And it is <head> and <body> tags.

<html>
<head>
	<title>
		This is Makew3web.
	<title>
</head>
<body>
	<H1>Welcome to HTML!</H1>
</body>
</html>

As you can see in the above example the head tag including information about your webpage should be displayed. And body tag contains the content (text)which you want to display.

Also, we have used the <h1> tag in between the <body> tag to indicate that the browser should display the text "Welcome to HTML!" in the web browser using heading number one (H1) which displays text huge and bold. you can see the result browser's result in the below image.

With this example, you've got a basic understanding of HTML tags and elements.

As you can see in the above example we have used HTML tags <html>, <head>, <title>, <body>, and <h1>to create the basic structure of our webpage.

One more noticeable thing is that tags like <html> and <body> enclose the other tags (you can check it in the above example), which allows you to create complex nested structures in your documents.

Was this page helpful?