What is text formatting tags in html

Text Formatting Tags in HTML with Examples

Text Formatting Tags in HTML with Examples HTML Formatting is the process of formatting text to improve its appearance and feel. HTML allows us to format text without using CSS. HTML contains numerous formatting tags, which we will cover today. Text can be bolded, italicised, or underlined using these tags. Formatting elements were designed to display special types of text. Here, we are going to learn 14 HTML formatting tags. All of the HTML formatting elements are listed below.

Читайте также:  Zend php extension directory

Bold and Strong

Making Text Bold or Strong: The tag can be used to make text bold or strong. Both opening and closing tags are used in the tag. The text that needs to be bolded must be enclosed by the and tags. We can also use the tag to emphasise the text’s semantic importance. It also begins with the tag and ends with the tag.

  Welcome fellow Frontend Developers!

This is an important content , and this is just normal content

Italic and Emphasis

Italicising or emphasising text: To italicise the text, use the tag. It begins with the tag and ends with the tag. The tag is used to emphasise text with additional semantic significance. It begins with the tag and ends with the tag.

  The term Front end describes all the parts of a website that can be seen and interacted with by users. Front end web development usually involves coding with HTML, CSS, and JavaScript.  Get out of bed now ! And start coding 

Highlighting Text

Highlighting text: The tag can also be used to mark or highlight text in HTML. It has a opening tag and a closing tag.

  Do not forget to comment your code. 

Teletype Text

The element was used to identify text to be displayed using the browser’s default monospace or fixed-width font as it would appear on a fixed-width device such as a teletype. This element has been deprecated and the element is an appropriate modern replacement for .

  

Who is old enough to remember teletype?

Underline and Strike

The tag in HTML stands for underline, and it’s used to underline the text enclosed within the tag. This tag is generally used to underline misspelled words. This tag requires a starting as well as ending tag. Warning: In older versions of HTML, this element was known as the “Underline” element, and it is still sometimes used in this manner. Instead, use a style that includes the CSS text-decoration property set to underline to underline text. The tag defines a strike or line through Text. This tag creates a cut line in the text. This tag is depreciated from HTML5. Now, the tag is used instead of this tag.

  This is some misspelled text.  Invest in your potential. Develop skills for as low as £24.99 £14.99 — today only! 

Big and Small

Making text larger: If you want to put your font size larger than the rest of the text then put the content within . . It increase one font size larger than the previous one. Making text smaller: The is used to make the text smaller. The text that needs to be displayed smaller should be written inside . tags.

  This is the first sentence. This whole sentence is in bigger letters.   This is the first sentence. This whole sentence is in small letters.  

Delete and Insert

Striking through the text: The element is used to strike through the text marking the part as deleted. It also has an opening and a closing tag.
Adding a text: The element is used to underline a text marking the part as inserted or added. It also has an opening and a closing tag.

  My favourite code editor is Sublime Text VS Code ! 

Subscript and Superscript

Making a text Subscript or Superscript: The element is used to superscript a text and the element is used to subscript a text. They both have an opening and a closing tag.

  Make sure to drink plenty of H 2 O whilst working on your coding skills.  The world's most famous equation: E = mc 2

Conclusion

  • – Bold text
  • – Important text
  • – Italic text
  • – Emphasised text
  • – Marked text
  • – Teletype text (Not Supported in HTML5)
  • – Underline text
  • – Draw a strikethrough a section of text (Not Supported in HTML5)
  • – Increase font size by one conventional unit (Not Supported in HTML5)
  • – Decrease font size by one unit from the base font size
  • – Deleted text
  • – Inserted text
  • – Subscript text
  • – Superscript text

I hope you find these HTML formatting elements useful in making your next web page more appealing.

Further reading

Explore some other interesting HTML5 elements; over on MDN Web Docs – HTML elements reference – HTML: HyperText Markup Language | MDN.

See also

If you liked this article, then please share. You can also find me on Twitter for more updates.

Источник

HTML Text Formatting

HTML contains several elements for defining text with a special meaning.

Example

This is subscript and superscript

HTML Formatting Elements

Formatting elements were designed to display special types of text:

  • - Bold text
  • - Important text
  • - Italic text
  • - Emphasized text
  • - Marked text
  • - Smaller text
  • - Deleted text
  • - Inserted text
  • - Subscript text
  • - Superscript text

HTML and Elements

The HTML element defines bold text, without any extra importance.

Example

The HTML element defines text with strong importance. The content inside is typically displayed in bold.

Example

HTML and Elements

The HTML element defines a part of text in an alternate voice or mood. The content inside is typically displayed in italic.

Tip: The tag is often used to indicate a technical term, a phrase from another language, a thought, a ship name, etc.

Example

The HTML element defines emphasized text. The content inside is typically displayed in italic.

Tip: A screen reader will pronounce the words in with an emphasis, using verbal stress.

Example

HTML Element

The HTML element defines smaller text:

Example

HTML Element

The HTML element defines text that should be marked or highlighted:

Example

Do not forget to buy milk today.

HTML Element

The HTML element defines text that has been deleted from a document. Browsers will usually strike a line through deleted text:

Example

My favorite color is blue red.

HTML Element

The HTML element defines a text that has been inserted into a document. Browsers will usually underline inserted text:

Example

HTML Element

The HTML element defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font. Subscript text can be used for chemical formulas, like H2O:

Example

HTML Element

The HTML element defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font. Superscript text can be used for footnotes, like WWW [1] :

Example

This is superscripted text.

HTML Exercises

HTML Text Formatting Elements

Tag Description
Defines bold text
Defines emphasized text
Defines a part of text in an alternate voice or mood
Defines smaller text
Defines important text
Defines subscripted text
Defines superscripted text
Defines inserted text
Defines deleted text
Defines marked/highlighted text

For a complete list of all available HTML tags, visit our HTML Tag Reference.

Источник

HTML Tags for Text Formatting

In HTML, a number of elements are used to format text. The formatting tags are divided into two groups: physical tags, that are used to style the text (visual appearance of the text) and logical or semantic tags that add semantic value to the text parts (e. g., inform search engines for which keywords a web page should be ranked).

Let’s dive deeper and talk about formatting tags in details.

The - Tags

The - tags are used to define HTML headings. There are 6 levels of headings in HTML, the defines the most and the least important headings.

Example of the HTML - tags:

html> html> head> title>Title of the document title> head> body> 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> body> html>

Result

HTML headings

The and Tags

Example of the HTML and tags:

html> html> head> title>Title of the document title> head> body> p>We use the <strong> tag to highlight the importance strong> of this part of the text strong>. p> p>The <b> tag is a physical tag that stands for b>bold text b>. p> body> html>

The and Tags

Example of the HTML and tags:

html> html> body> p>This is a paragraph p> p>The important part of the text is defined em> in italic em>. p> p>i>Lorem ipsum i>, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. p> body> html>
html> html> head> title>Title of the document title> head> body> pre>Spaces and line breaks within this element are shown as typed. pre> body> html>

The Tag

Example of the HTML tag:

html> html> head> title>Title of the document title> head> body> p>Learn the HyperText Markup Language on mark>W3Docs.com mark>. p> body> html>

Result

marked-text

The Tag

Example of the HTML tag:

html> html> head> title>Usage of the SMALL tag title> head> body> p>The interest rate is only 10%* p> small>* per day small> / body> html>

The and Tags

Example of the HTML tag:

html> html> head> title>Title of the document title> head> body> p> She likes del>violets del> snowdrops․ p> body> html>

Example of the HTML tag:

html> html> head> title>Title of the document title> head> body> p>s>I am studying in high school. s> p> p>I am studying in a university. p> body> html>

The content of both tags is displayed as strikethrough. However, despite the visual similarity, these tags cannot replace each other.

The and Tags

Example of the HTML tag:

html> html> head> title>Title of the document title> head> body> p>She likes del>violets del> ins>snowdrops ins>․ p> body> html>

Result

inserted-text

Example of the HTML tag:

html> html> head> title>Title of the document title> head> body> p>Here we used u>the <u> tag u>. p> body> html>

The and

Example of the HTML and tags:

html> html> head> title>Title of the document title> head> body> p>The formula of water is Hsub>2 sub>O, and the formula of alcohol is Csub>2 sub>Hsub>5 sub>ОН p> p>E = mcsup>2 sup>, where E — kinetic energy, m — mass, c — the speed of light. p> body> html>

Result

subscript-superscript-text

The Tag

Example of the HTML tag:

html> html> head> title>Title of the document title> head> body> p>dfn>HTML dfn> (HyperText Markup Language ) — The standardized markup language for documents on the World Wide Web. Most web pages contain a description of the markup in the language HTML p> body> html>

The

,
and


Tags

Example of the HTML

tag:

html> html> head> title>Title of the document title> head> body> p>The first paragraph p> p>The second paragraph p> body> html>

Example of the HTML
tag:

html> html> head> title>Title of the document. title> head> body> h1>How to use the <br> tag h1> p> We can insert the <br /> tag inside the paragraph, br /> to transfer a part of the text to another line if necessary. p> body> html>

Example of the HTML


tag:

html> html> head> title>Title of the document title> head> body> h1>Football h1> p>A team sport involving kicking a ball to score a goal. p> hr> h1>Basketball h1> p>A game that is played between two teams of five players. p> body> html>

Источник

Оцените статью