-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathBuilding_blocks_of.HTML
30 lines (27 loc) · 1.11 KB
/
Building_blocks_of.HTML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Building blocks of HTML
An HTML document consist of its basic building blocks which are:
Tags: An HTML tag surrounds the content and apply meaning to it. It is written between < and > brackets.
Attribute: An attribute in HTML provides extra information about the element, and it is applied within the start tag. An HTML attribute contains two fields: name & value.
Syntax
<tag name attribute_name= " attr_value"> content </ tag name>
Elements: An HTML element is an individual component of an HTML file. In an HTML file, everything written within tags are termed as HTML elements.
HTML Building blocks
Example:
<!DOCTYPE html>
<html>
<head>
<title>The basic building blocks of HTML</title>
</head>
<body>
<h2>The building blocks</h2>
<p>This is a paragraph tag</p>
<p style="color: red">The style is attribute of paragraph tag</p>
<span>The element contains tag, attribute and content</span>
</body>
</html>
Test it Now
Output:-
The building blocks
This is a paragraph tag
The style is attribute of paragraph tag
The element contains tag, attribute and content