What are the Building Blocks of HTML?
Last Updated :
31 Jan, 2024
HTML is the backbone of web content, which consists of fundamental building blocks that define the structure of a webpage. These building blocks include elements like Tags, Attributes, and Elements.
Features
- HTML elements define the structure of a web page.
- Tags provide semantic meaning to content, such as headings, paragraphs, lists, etc.
- Attributes can be added to tags to provide additional information or functionality.
Syntax:
<!DOCTYPE html>
<html>
<head>
<title>Your Title Here</title>
</head>
<body>
<!-- Your content goes here -->
</body>
</html>
Building Blocks
Tags |
<p> |
Defines a paragraph. |
|
<h1> to <h6> |
Define headings of different levels. |
|
<a> |
Creates hyperlinks. |
|
<img> |
Embeds images. |
Attributes |
class |
Specifies one or more class names. |
|
id |
Specifies a unique id for an element. |
|
src |
Specifies the source URL for embedded content |
|
alt |
Specifies alternative text for images. |
Elements |
<html> |
Represents the root element of an HTML page. |
|
<head> |
Contains meta-information about the document. |
|
<body> |
Contains the content of the HTML document. |
|
<div> |
Defines a division or a section. |
|
<span> |
Defines a small section in a document. |
Share your thoughts in the comments
Please Login to comment...