Horje
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

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



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

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

Read Full::
HTML Tag
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded:
7 months ago
Uploaded by:
Admin
Views:
1
Ref on:
View



Share on: