Complete Header tags in html – easy to learn
H tags can be used to easily write headlines in HTML. There are 6 different types of H tags. These are <h1>, <h2>, <h3>, <h4>, <h5> and <h6>. The <h1> to <h6> tags are used to define HTML headings. These have their own default styles. <h1> is Defines the most important heading. <h6> is Defines the least important heading.
Example is below.
HTML Header display Code block
<!DOCTYPE html> <html> <head> <title>Site title / Page title</title> </head> <body> <h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> <p> this is paragraph</p> </body> </html>
result : See the below image.
Default CSS style of H tags
See the image below for how to get the CSS value of the h tag
Most browsers display the <H1> tag element with the following default values.
Default CSS style of H1 tag
display : block;
font-size : 2em;
margin-block-start : 0.67em;
margin-block-end : 0.67em;
margin-inline-start : 0px;
margin-inline-end : 0px;
font-weight : bold;
}
<H2> tag element with the following default values.
Default CSS style of H2 tag
display : block;
font-size : 1.5em;
margin-block-start : 0.83em;
margin-block-end : 0.83em;
margin-inline-start : 0px;
margin-inline-end : 0px;
font-weight : bold; }
<H3> tag element with the following default values.
Default CSS style of H3 tag
display : block;
font-size : 1.17em;
margin-block-start : 1em;
margin-block-end : 1em;
margin-inline-start : 0px;
margin-inline-end : 0px;
font-weight : bold; }
<H4> tag element with the following default values. The font size of the H4 tag is 1em. So Most browsers will not display the font size.
Default CSS style of H4 tag
display : block;
margin-block-start : 1.33em;
margin-block-end : 1.33em;
margin-inline-start : 0px;
margin-inline-end : 0px;
font-weight : bold; }
<H5> tag element with the following default values.
Default CSS style of H5 tag
display : block;
font-size : 0.83em;
margin-block-start : 1.67em;
margin-block-end : 1.67em;
margin-inline-start : 0px;
margin-inline-end : 0px;
font-weight : bold; }
<H6> tag element with the following default values.
Default CSS style of H6 tag
display : block;
font-size : 0.67em;
margin-block-start : 2.33em;
margin-block-end : 2.33em;
margin-inline-start : 0px;
margin-inline-end : 0px;
font-weight : bold;
}
Popular post
-
Eclipse IDE – Create New Java Project.
Opening the New Java Project…
-
How to start the project in android studio
Android Studio Open the Android…
-
How to use ACOSH function in excel
The ACOSH function returns the…
-
Complete Header tags in html – easy to learn
H tags can be used…
-
Best features in Python programme – easy to learn
Python is the most widely…