Horje
What is HTML <h1> to <h6> Tags | HTML Tag Code
What is HTML <h1> to <h6> Tags

The <h1> to <h6> tags are used to define HTML headings.

<h1> defines the most important heading. <h6> defines the least important heading.

Note: Only use one <h1> per page - this should represent the main heading/subject for the whole page. Also, do not skip heading levels - start with <h1>, then use <h2>, and so on.


How to create HTML <h1> to <h6> Tags

The six different HTML headings
index.html
Example: HTML
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6> 

Output should be:

How to create HTML <h1> to <h6> Tags

Which browser will support for HTML <h1> to <h6> Tags

See the Screen
Which browser will support for HTML <h1> to <h6> Tags

How to Set the background color and text color of headings (with CSS)

See the Example
index.html
Example: HTML
<h1 style="background-color:DodgerBlue;">Hello World</h1>
<h2 style="color:Tomato;">Hello World</h2> 

Output should be:

How to Set the background color and text color of headings (with CSS)

How to set Default CSS Settings for HTML <h1> to <h6> Tags

Change the default CSS settings to see the effect.
index.html
Example: HTML
<style>
h1 { 
  display: block;
  font-size: 2em;
  margin-top: 0.67em;
  margin-bottom: 0.67em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}
</style>

Output should be:

How to set Default CSS Settings for HTML <h1> to <h6> Tags

Most browsers will display the <h2> element with the following default values
index.html
Example: HTML
<style>
h2 { 
  display: block;
  font-size: 1.5em;
  margin-top: 0.83em;
  margin-bottom: 0.83em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}
</style>

Output should be:

How to Set the alignment of headings (with CSS)

See the Example

index.html
Example: HTML
 <h1 style="text-align:center">This is heading 1</h1>
<h2 style="text-align:left">This is heading 2</h2>
<h3 style="text-align:right">This is heading 3</h3>
<h4 style="text-align:justify">This is heading 4</h4> 

Output should be:

How to Set the alignment of headings (with CSS)

Most browsers will display the <h2> element with the following default values

See the Example

index.html
Example: HTML
<style>
h2 { 
  display: block;
  font-size: 1.5em;
  margin-top: 0.83em;
  margin-bottom: 0.83em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}
</style>

Output should be:

Most browsers will display the <h2> element with the following default values

Most browsers will display the <h3> element with the following default values

index.html
Example: HTML
<style>
h3 { 
  display: block;
  font-size: 1.17em;
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}
</style>

Output should be:

Most browsers will display the <h3> element with the following default values

Most browsers will display the <h4> element with the following default values

See the Example

index.html
Example: HTML
<style>
h4 { 
  display: block;
  font-size: 1em;
  margin-top: 1.33em;
  margin-bottom: 1.33em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}
</style>

Output should be:

Most browsers will display the <h4> element with the following default values

Most browsers will display the <h5> element with the following default values

See the Example

index.html
Example: HTML
<style>
h5 { 
  display: block;
  font-size: .83em;
  margin-top: 1.67em;
  margin-bottom: 1.67em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}
</style>

Output should be:

Most browsers will display the <h5> element with the following default values

Most browsers will display the <h6> element with the following default values

See the Example

index.html
Example: HTML
<style>
h6 { 
  display: block;
  font-size: .67em;
  margin-top: 2.33em;
  margin-bottom: 2.33em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}
</style>

Output should be:

Most browsers will display the <h6> element with the following default values

H1 to H6 Font-sizes with CSS

See the Example

<h1>Hello world</h1>
<h2>Hello world</h2>
<h3>Hello world</h3>
<h4>Hello world</h4>
<h5>Hello world</h5>
<h6>Hello world</h6>

Output should be:

H1 to H6 Font-sizes with CSS
Reffered: https://www.w3schools.com/tags/tag_hn.asp



Read Full::
HTML Tag Code
Category:
HTML Code
Sub Category:
HTML Tag Code
Uploaded:
3 weeks ago
Uploaded by:
Admin
Views:
29

Related Articles
What is HTML <!--...--> Tag HTML Tag Code
What is HTML <!DOCTYPE> Declaration HTML Tag Code
What is HTML Elements and Doctypes HTML Tag Code
What is HTML <a> Tag HTML Tag Code
What is HTML <abbr> Tag HTML Tag Code
What is HTML <address> Tag HTML Tag Code
What is HTML <applet> Tag HTML Tag Code
What is HTML <area> Tag HTML Tag Code
What is HTML <article> Tag HTML Tag Code
What is HTML <aside> Tag HTML Tag Code
What is HTML <audio> Tag HTML Tag Code
What is HTML <b> Tag HTML Tag Code
What is HTML <base> Tag HTML Tag Code
What is HTML <basefont> Tag HTML Tag Code
What is HTML <bdi> Tag HTML Tag Code
What is HTML <bdo> Tag HTML Tag Code
What is HTML <big> Tag HTML Tag Code
What is HTML <blockquote> Tag HTML Tag Code
What is HTML <body> Tag HTML Tag Code
What is HTML <br> Tag HTML Tag Code
What is HTML <button> Tag HTML Tag Code
What is HTML <canvas> Tag HTML Tag Code
What is HTML <caption> Tag HTML Tag Code
What is HTML <center> Tag HTML Tag Code
What is HTML <cite> Tag HTML Tag Code
What is HTML <code> Tag HTML Tag Code
What is HTML <col> Tag HTML Tag Code
How to create HTML <colgroup> Tag HTML Tag Code
What is HTML <data> Tag HTML Tag Code
What is HTML <datalist> Tag HTML Tag Code
What is HTML <dd> Tag HTML Tag Code
What is HTML <del> Tag HTML Tag Code
What is HTML <details> Tag HTML Tag Code
What is HTML <dfn> Tag HTML Tag Code
What is HTML <dialog> Tag HTML Tag Code
What is HTML <dir> Tag HTML Tag Code
What is HTML <div> Tag HTML Tag Code
What is HTML <dl> Tag HTML Tag Code
What is HTML <dt> Tag HTML Tag Code
What is HTML <em> Tag HTML Tag Code
What is HTML <embed> Tag HTML Tag Code
What is HTML <fieldset> Tag HTML Tag Code
What is HTML <figcaption> Tag HTML Tag Code
What is HTML <figure> Tag HTML Tag Code
What is HTML <font> Tag HTML Tag Code
What is HTML <footer> Tag HTML Tag Code
What is HTML <form> Tag HTML Tag Code
What is HTML <frame> Tag HTML Tag Code
What is HTML <frameset> Tag HTML Tag Code
What is HTML <h1> to <h6> Tags HTML Tag Code
What is HTML <head> Tag HTML Tag Code
What is HTML <header> Tag HTML Tag Code
What is HTML <hgroup> Tag HTML Tag Code
What is HTML <hr> Tag HTML Tag Code
What is HTML <html> Tag HTML Tag Code
What is HTML <i> Tag HTML Tag Code
What is HTML <iframe> Tag HTML Tag Code
What is HTML <img> Tag HTML Tag Code

Single Articles
How to create HTML <h1> to <h6> Tags
Which browser will support for HTML <h1> to <h6> Tags
How to Set the background color and text color of headings (with CSS)
How to set Default CSS Settings for HTML <h1> to <h6> Tags
How to Set the alignment of headings (with CSS)
Most browsers will display the <h2> element with the following default values
Most browsers will display the <h3> element with the following default values
Most browsers will display the <h4> element with the following default values
Most browsers will display the <h5> element with the following default values
Most browsers will display the <h6> element with the following default values
H1 to H6 Font-sizes with CSS

Share on: