×

HTML Headings

The titles and subtitles of our webpages are known as HTML headings. Let’s not talk about webpages but giving heading to almost everything like normal paragraphs, articles or let it be anything, emphasizes them. A heading is something which is a one-word summary for our whole topic or we can say webpage in html’s case.

In html, we define headings with the <h1> to <h6> tags. Here <h1> defines the most important heading whereas <h6> defines the least important heading among them all. Therefore, h1 being the biggest heading of them all and h6 being the smallest.

While using html, our browsers automatically add some white space or we can say margin to the left and right side of our heading, to distinguish it from the other content. Below is the example that shows the size of headings from <h1> to <h6>, and their white spaces as well.

For example:

<body>
<h1>This is my first heading</h1>
<h2>This is my second heading</h2>
<h3>This is my third heading</h3>
<h4>This is my fourth heading</h4>
<h5>This is my fifth heading</h5>
<h6>This is my sixth heading</h6>
</body>
</html> 

Output:

HTML Headings

Importance of headings

Search engines take the help of headings to index the structure and content of our webpage. Users sometimes judge the webpages by their headings only. It is very important to use heading to show the documented structure of our webpage as mentioned before. <h1> heading should always be used for main heading which shows the summary of the written content or we can say it should determine the purpose of webpage followed by <h2> heading and <h3> and then carry on like this to <h6>. Personal advice from our side, that use html headings for headings only do not use them to make your text big or bold.

Bigger headings

Each and every html heading has a different and default size. However, we can change or we can modify their sizes by using style attribute, or by using the CSS font-size property. Below is the example that shows how we can give bigger headings with the help of CSS properties.

For example:

<html>
<body>
<h1 style=”font-size: 60px;”>Heading 1</h1>
<p>This is an example which shows how we can change the size of a heading with the style attribute, using the font size property.</p>
</body>
</html> 

Output:

HTML Headings

Related Topics

How to change text color in HTML

Changing the text colour of a web page is essential because it enhances readability. There are several ways to change the colour of the text in HTML, which are as follows: Text...

7 minutes read.

HTML <samp> tag

The Samp tag in HTML is used for defining the sample output from the computer program. This tag is a phrase type tag and a container tag that means the...

2 minutes read.

HTML <table> tag

The Table element If we want to show the data and information in a two-dimensional table with rows and columns, then we can achieve this by using the HTML element <table>. Syntax: <body> <table> <thead> <tr> <thcolspan="#">………….</th> </tr> </thead> <tbody> <tr> <td>……….</td> <td>……….</td> </tr> </tbody> </table> </body> Example: <!DOCTYPE...

9 minutes read.

HTML Images

HTML has <img> tag to display image on the web pages or web application. This tag is an empty tag i.e. we don't have to close this tag while using. SYNTAX: <img src="source address" attributes="alt, height, width"> Example: <html>   <body>   <center>Image tag Example</center>   <img src="https://www.tutorialandexample.com/resources/images/favicon.png"    alt="tutorialandexample"/>   </body>   </html> Output: Image...

1 minute read.

HTML Hide Element

The HTML hide element is used to hide the element. We place the hidden attribute inside those elements which we want to hide. The hidden attribute is a Boolean attribute. The...

3 minutes read.

HTML Font Color

The HTML <font> tag has an attribute called color, which defines the color of the text. We use the color attribute inside the <font> tag to specify the color of...

6 minutes read.

HTML <video> Tag

The Video tag in HTML is used to play video on a media player on the web page. We can also insert an audio by the video tag, but audio...

6 minutes read.

HTML 5 Tutorial

What is HTML5? HTML5 is a programming language which stands for the acronym Hyper Text Markup Language 5. It is program that enables the appearance of web pages to be changed, as well as changes...

5 minutes read.

HTML Font Size

The HTML <font> tag uses the size attribute to specify the size of the text. We can set the size attribute’s value from 1 to 7. The default size of...

4 minutes read.

HTML Background Image

Inserting image in HTML An image (technically digital image) in HTML or even in general technical aspects, is a binary representation of visual information. By visual information we mean, in the...

8 minutes read.

Html Wbr Tag

The Line Break Opportunity element A word break opportunity is a place in text from where the browser breaks a line. This opportunity is represented by the element wbr in the...

2 minutes read.

HTML Links

It consist of anchor element which is used to create a link between a source anchor and destination anchor. The anchor tag can be embedded between text, image, video or...

2 minutes read.

HTML <script> Tag

For embedding a client -side script, we use script tag in html tag. This <script> tag can be used for containing scripting statements. It can also point another external script file...

2 minutes read.

HTML Button Disabled

The HTML <button> element has many attributes, one of them is the disabled attribute. The button on which you apply the disabled attribute will not work, or we can say...

4 minutes read.

Html &lt;datalist >Tag

The autocomplete feature in HTML files is provided by the <datalist> tag. It can be used in conjunction with an input tag to enable users to quickly fill out form...

4 minutes read.

HTML Reset Button

The HTML reset button is used to reset all values in the form. It clears all input fields. Reset is the value of the type attribute of the button element. The...

6 minutes read.

HTML Ordered List

We use <ol> tag to make an ordered list in html. An ordered list is made to make a list of items in ordered form, ordered list can be either...

3 minutes read.

HTML Tutorial

Introduction This HTML tutorial helps beginners and professionals to learn HTML easily. HTML is a widely used web technology for website development. It stands for Hyper Text Markup Language. It is mainly used to...

7 minutes read.

HTML <source> tag

For media attributes, such as <video> tag, <audio> tag, and <picture> tag, we use the <source> tag in html for adding such type of multiple media html elements in our...

4 minutes read.

HTML &lt;body> alink Attribute

HTML <body> alink Attribute What is HTML? The HTML or HyperText Markup Language is used to design web pages. The file extension name for HTML file is ".html". It was released in...

2 minutes read.