HTML Formatting is a process of formatting text for a better look and feel. HTML provides us the ability to format text without using CSS. There are many formatting tags in HTML. These tags are used to make text bold, italicized, or underlined. There are almost 14 options available that how text appears in HTML and XHTML.

In HTML the formatting tags are divided into two categories:

Physical tag: These tags are used to provide a visual appearance to the text.

Logical tag: These tags are used to add some logical or semantic value to the text.

Formatting tags are:

1.      <b> - Bold text.

This is a physical tag, which is used to bold the text written between it.

2.      <strong> - Important text.

This is a logical tag, which tells the browser that the text is important.oldi> - Italic text.

 3.      <em> - Emphasized text.

This is a physical tag that is used to make the text italic.

4.      <mark> - Marked text.

This tag is used to highlight text.

 5.      <sub> - Subscript text.

It displays the content slightly below the normal line.

 6.      <sup> - Superscript text.

It displays the content slightly above the normal line.

Semantic Tags

Semantic elements have meaningful names which tell about the type of content. For example header, footer, table, etc. HTML5 introduces many semantic elements as mentioned below which make the code easier to write and understand for the developer as well as instruct the browser on how to treat them.

Semantic tags are listed below: Semantics elements

1) Header tag

The <header> element represents a container for introductory content or a set of navigational links.

 <header> element typically contains:

•           one or more heading elements (<h1> - <h6>)

•           logo or icon

•           authorship information


2) Footer tag

The <footer> element defines a footer for a document or section.

<footer> element typically contains:

authorship information

copyright information

contact information

sitemap

back to top links

related documents.

 

3) Figure Tag

The <figure> tag specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.

4) Figcaption Tag

The <figcaption> tag defines a caption for a <figure> element. The <figcaption> element can be placed as the first or as the last child of a <figure> element.

5) Navigation Tag

The <nav> element defines a set of navigation links.

6) Article Tag

The <article> element specifies independent, self-contained content.

An article should make sense on its own, and it should be possible to distribute it independently from the rest of the website.

7) Section Tag

The <section> element defines a section in a document.

According to W3C’s HTML documentation: “A section is a thematic grouping of content, typically with a heading.”

8) Summary Tag

The <summary> tag defines a visible heading for the <details> element. The heading can be clicked to view/hide the details.