How to Create Bold and Italic Headings in HTML

Embed italic and bold style markup tags in your header HTML code to add emphasis to your list of topics.


Heading tags are the easiest way to break up your document. If you think of your site like a newspaper, then headlines are the headlines in the newspaper. The main headline is an h1 and the following are h2 to h6.

Use the following codes to create the HTML.

This is Heading 2This is Heading 3This is Heading 4/i>
This is Heading 5/i>
This is heading 6;

tips to remember

  • Try to keep your headers in a logical order, h1 comes before h2, which comes before h3, and so on.
  • Don’t worry too much about how the titles look – you should use CSS to style the headlines instead of using a title out of order.
  • Header tags are block-level elements, so they put in the line breaks for you. Don’t put P tags inside header tags.

bold and italic

There are four tags you can use for bold and italics:

  • and and for bold
  • and for italics

It doesn’t matter which one you use. While some prefer and , but many people find for “bold” and for “italic” i> easier to remember. i>.

Simply surround the text with the opening and closing tags, to make the text bold or italic:

  bold  /b> 
 italic i> italic i>;

You can nest these tags (meaning you can make text bold and italic) and it doesn’t matter what the outer or inner tag is.

For example:

This text is in bold

This text is in italics

This text is in bold and italic

Why are there two sets of bold and italic labels?

In HTML4, and tags were considered style tags that affected only the appearance of the text and said nothing about the content of the tag, and their use was considered incorrect. Then, with HTML5, they were given a semantic meaning outside of the appearance of the text.

In HTML5 these tags have specific meanings:

  • denotes text that is not more important than the surrounding text, but the typical typographic display is bold text, such as keywords in a document summary or product names in a review.
  • denotes text that is no more important than the surrounding text, but the typical typographic presentation is text in italics, such as a book title, a technical term, or a phrase in another language.
  • denotes text that has great importance compared to the surrounding text.
  • denotes a text that has an emphatic stress compared to the surrounding text.