Basic Tags and Attributes in HTML
What is an Attribute?
- HTML attributes are style modifiers for an HTML element type.
- Attributes define additional characteristics or properties of the element such as height, width, align, etc.
- Attributes are always specified in the opening tag.
- Attributes are specified as name-value pairs and values should be enclosed in quotation marks like name="value".
Body tag and its attributes
Background attribute
This attribute is used to specify the backgroung image of the HTML page.
For Example: <body background ="background_image.jpg" >

Bgcolor attribute
This attribute is used to specify the backgroung color of the HTML page.
For Example: <body bgcolor ="blue" >

Text attribute
This attribute is used to specify the color of text of the entire HTML page.
For Example: <body text ="red" >

Heading Tags
Heading Tags are used to define the different heading levels in an HTML document.
There are 6 Heading tags: H1 to H6, H1 displaying text in the largest size and H6 in the smallest size.
Heading Tags are usually used for main headings and sub heading.

Align attribute
This attribute is used to align Headings in an HTML document.
The align attribute has 4 values:
<h1
align ="center"
> - Aligns the text in the center.
<h1
align ="right"
> - Aligns the text to the right side.
<h1
align ="wrong"
> - Aligns the text to the left side.
<h1
align ="justify"
> - Aligns the text from both left and right margins.

Paragraph Tag
Paragraph tags are used to display a block of text as a paragraph in an HTML document.
Every paragraph begins from a new line.
When you start a new paragraph, the web browsers will leave some space between the paragraphs.
The Align attribute can also be given with <p> tags, <hr> tags, <span> tags, heading tags, etc.

<hr> Tag
<hr> tags are used as a separator between blocks of text in an HTML document.
The <hr> tag draws a horizontal line across the page.
The size attribute of <hr> tag is given in pixels.
The attributes of <hr> tag include are:
Size : Specifies the thickness of the horizontal rule. <hr size ="4">
Width : Specifies the length of the horizontal rule. <hr width ="80%">
Align : Specifies the alignment of the horizontal rule. The possible values for align attribute include right, left and center. <hr align ="center">
Color : Specifies the color of the horizontal rule. <hr color ="red">
Noshade : This attribute produces a solid block horizontal rule with no shading. <hr noshade >

Center Tag
The <center> tag
is used to align the text to the center of the page.
The contents between the opening and closing <center> tag
will be centered in the display window.

Comments in HTML
Sometimes you might want to write notes for yourself in an HTML document, but don't want this to appear in the browser window.
This is where the Comment tag comes in.
<!-- This is how a comment is written -->
Note that only the opening tag of a comment has an exclamation mark(!).
For Example:
<html>
<head>
<title>Example | Kode.Blox
</title>
</head>
<body
bgcolor ="black"
text ="white"
>
<!-- This example will help you understand how attributes and comments work in HTML. -->
<center>
<h1>
Today's Motivation!
</h1>
</center>
<hr
size ="2"
width ="90%"
color ="yellow"
>
<p>
“Knowing Is Not Enough; We Must Apply. Wishing Is Not Enough; We Must Do.”
</p>
<p
align ="right"
>
Johann Wolfgang Von Goethe
</p>
<hr
size ="4"
width ="80%"
noshade
>
</body>
</html>