

{"id":78505,"date":"2020-06-26T09:00:26","date_gmt":"2020-06-26T03:30:26","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=78505"},"modified":"2024-07-26T13:28:52","modified_gmt":"2024-07-26T07:58:52","slug":"html-formatting","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/html-formatting\/","title":{"rendered":"HTML Formatting &#8211; Learn Text Formatting in HTML"},"content":{"rendered":"<p>HTML Formatting basically refers to the enhancing of text in order to increase the visual appeal. HTML provides a range of formatting tags that can be used to make the text attractive to the users. There are many options available that can be used for formatting, just like any other text editor.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78694\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags.jpg\" alt=\"HTML Formatting tags\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<h2>HTML Formatting Tags<\/h2>\n<p>There are two types of HTML tags:<\/p>\n<ul>\n<li><strong>Physical tags-<\/strong> These tags provide a visual appeal to the document. For example, bold, italic, underlined, etc.<\/li>\n<li><strong>Logical tags-<\/strong> These tags provide a logical meaning to the text. For example, the &lt;strong&gt; tag.<\/li>\n<\/ul>\n<h2>Formatting Text in HTML<\/h2>\n<p>Now, we shall discuss some of the major formatting text in HTML.<\/p>\n<h3>1. HTML Headings<\/h3>\n<p>HTML headings range from 1 to 6. The heading defined within <strong>&lt;h1&gt;<\/strong> is the more important i.e. larger font-size and font-weight whereas <strong>&lt;h6&gt;<\/strong> is the least important i.e. least font-size. These headings can be judiciously used to format the text.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;html&gt; \r\n&lt;head&gt; \r\n&lt;title&gt;DataFlair&lt;\/title&gt; \r\n&lt;\/head&gt; \r\n&lt;body&gt; \r\n&lt;h1&gt;DataFlair Heading 1&lt;\/h1&gt;\r\n&lt;h2&gt;DataFlair Heading 2&lt;\/h2&gt;\r\n&lt;h3&gt;DataFlair Heading 3&lt;\/h3&gt;\r\n&lt;h4&gt;DataFlair Heading 4&lt;\/h4&gt;\r\n&lt;h5&gt;DataFlair Heading 5&lt;\/h5&gt;\r\n&lt;h6&gt;DataFlair Heading 6&lt;\/h6&gt;\r\n&lt;\/body&gt; \r\n&lt;\/html&gt; \r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-252-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78705\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-252-1.png\" alt=\"html heading tag\" width=\"502\" height=\"317\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-252-1.png 502w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-252-1-300x189.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-252-1-150x95.png 150w\" sizes=\"auto, (max-width: 502px) 100vw, 502px\" \/><\/a><\/p>\n<p>Besides headings, there are numerous tags in HTML to adjust the appearance of the text in question directly. These tags are referred to as the physical tags that enable development of simple qualities like the bold, italics, underlined styles among others where emphasis on the text message is required. Whereas, logical tags add semantic meaning to the text, thereby aiding the search engine and the screen readers to interpret the text better.<\/p>\n<h3>2. HTML Bold text<\/h3>\n<p>This is defined by the <strong>&lt;b&gt;<\/strong> tag. This is a physical tag which is used to display the text in Bold. For example,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt; \r\n&lt;body&gt;\r\n&lt;p&gt;&lt;b&gt;Welcome to DataFlair!&lt;\/b&gt;&lt;\/p&gt;\r\n&lt;\/body&gt;    \r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-291-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78707\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-291-1.png\" alt=\"html strong tag\" width=\"232\" height=\"57\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-291-1.png 232w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-291-1-150x37.png 150w\" sizes=\"auto, (max-width: 232px) 100vw, 232px\" \/><\/a><\/p>\n<h3>3. HTML Strong Element<\/h3>\n<p>It displays the content in a manner such that it appears as important.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt; \r\n&lt;body&gt;\r\n&lt;p&gt;&lt;strong&gt;Welcome to DataFlair!&lt;\/strong&gt;&lt;\/p&gt;\r\n&lt;\/body&gt;    \r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-303-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78708\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-303-1.png\" alt=\"html bold tag\" width=\"347\" height=\"115\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-303-1.png 347w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-303-1-300x99.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-303-1-150x50.png 150w\" sizes=\"auto, (max-width: 347px) 100vw, 347px\" \/><\/a><\/p>\n<h3>4. HTML Underlining the text<\/h3>\n<p>In HTML, the text can be underlined using the <strong>&lt;u&gt;<\/strong> element, in order to emphasize on its importance. For example,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt; \r\n&lt;body&gt;\r\n&lt;p&gt;Welcome to DataFlair!&lt;\/p&gt;\r\n&lt;p&gt;&lt;u&gt;Welcome to DataFlair!&lt;\/u&gt;&lt;\/p&gt;\r\n&lt;\/body&gt;    \r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-305-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78704\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-305-1.png\" alt=\"html underline text\" width=\"309\" height=\"106\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-305-1.png 309w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-305-1-300x103.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-305-1-150x51.png 150w\" sizes=\"auto, (max-width: 309px) 100vw, 309px\" \/><\/a><\/p>\n<h3>5. HTML Highlight<\/h3>\n<p>In HTML, the<strong> &lt;mark&gt;<\/strong> element is used to highlight the text. For example,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt; \r\n&lt;body&gt;\r\n&lt;p&gt;&lt;mark&gt;Welcome to DataFlair!&lt;\/mark&gt;&lt;\/p&gt;\r\n&lt;\/body&gt;    \r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-293.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78702\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-293.png\" alt=\"HTML Highlight\" width=\"293\" height=\"58\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-293.png 293w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-293-150x30.png 150w\" sizes=\"auto, (max-width: 293px) 100vw, 293px\" \/><\/a><\/p>\n<h3>6. HTML Small text<\/h3>\n<p>This element is used to define small texts which can be used to add comments,notes,copyright,etc. For example,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt; \r\n&lt;body&gt;\r\n&lt;p&gt;&lt;small&gt;Welcome to DataFlair!&lt;\/small&gt;&lt;\/p&gt;\r\n&lt;\/body&gt;    \r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-295.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78701\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-295.png\" alt=\"HTML text font\" width=\"247\" height=\"58\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-295.png 247w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-295-150x35.png 150w\" sizes=\"auto, (max-width: 247px) 100vw, 247px\" \/><\/a><\/p>\n<h3>7. HTML Superscript and Subscript<\/h3>\n<ul>\n<li><strong>&lt;sup&gt;-<\/strong> It displays the content in superscript.<\/li>\n<li><strong>&lt;sub&gt;-<\/strong> It displays the content in subscript.<\/li>\n<\/ul>\n<p>For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt; \r\n&lt;body&gt;\r\n&lt;p&gt;&lt;small&gt;Welcome to DataFlair!&lt;sup&gt;E-learning!&lt;\/sup&gt;&lt;\/small&gt;&lt;\/p&gt;\r\n&lt;p&gt;&lt;small&gt;Welcome to DataFlair!&lt;sub&gt;E-learning!&lt;\/sub&gt;&lt;\/small&gt;&lt;\/p&gt;\r\n&lt;\/body&gt;    \r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-297.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78700\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-297.png\" alt=\"HTML Formatting\" width=\"243\" height=\"83\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-297.png 243w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-297-150x51.png 150w\" sizes=\"auto, (max-width: 243px) 100vw, 243px\" \/><\/a><\/p>\n<h3>8. HTML Italicize and Emphasize<\/h3>\n<p>The &lt;i&gt; element is used to display the text it contains in italics.<br \/>\nThe &lt;em&gt; element displays the text in italics along with semantic importance i.e. it emphasizes the text. For example,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt; \r\n&lt;body&gt;\r\n&lt;p&gt;&lt;i&gt;Welcome to DataFlair!&lt;\/i&gt;&lt;\/p&gt;\r\n&lt;p&gt;&lt;em&gt;Welcome to DataFlair!&lt;\/em&gt;&lt;\/p&gt;\r\n&lt;\/body&gt;    \r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-303.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78698\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-303.png\" alt=\"HTML Italisize\" width=\"347\" height=\"115\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-303.png 347w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-303-300x99.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-303-150x50.png 150w\" sizes=\"auto, (max-width: 347px) 100vw, 347px\" \/><\/a><\/p>\n<p>HTML also contains some specific tags for the text, for example, tags for the superscript &lt;sup&gt; and subscript &lt;sub&gt;. These are especially helpful in scientific and mathematics oriented content that include use of exponentiation and chemical equations. These include the &lt;mark&gt; tag for highlighting which can be used for the information that needs to be noticed on a page and will help it stand out.<\/p>\n<p>Likewise, the &lt;small&gt; tag is helpful for the disclaimer and other important statements that they don\u2019t want to draw the reader\u2019s attention but still need to be on the page.<\/p>\n<h3>9. HTML Striking through and Inserting<\/h3>\n<p>In HTML, the <strong>&lt;del&gt;<\/strong> element is used to display a deleted text on the web-page, done by striking through the text, and the <strong>&lt;ins&gt;<\/strong> element is used to display the inserted text, shown underlined. For example,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt; \r\n&lt;body&gt;\r\n&lt;p&gt;Welcome to DataFlair!&lt;\/p&gt;\r\n&lt;p&gt;&lt;del&gt;Welcome to DataFlair!&lt;\/del&gt;&lt;\/p&gt;\r\n&lt;p&gt;&lt;ins&gt;Welcome to DataFlair!&lt;\/ins&gt;&lt;\/p&gt;\r\n&lt;\/body&gt;    \r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-301.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78699\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-301.png\" alt=\"HTML Striking\" width=\"270\" height=\"144\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-301.png 270w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-301-150x80.png 150w\" sizes=\"auto, (max-width: 270px) 100vw, 270px\" \/><\/a><\/p>\n<h3>10. HTML Preformatted text<\/h3>\n<p>The <strong>&lt;pre&gt;<\/strong> tag of HTML allows the developers to display the text in the same format i.e. spaces,tabs,line breaks,etc, as written in the code.For example,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;html&gt; \r\n&lt;head&gt; \r\n&lt;title&gt;DataFlair&lt;\/title&gt; \r\n&lt;\/head&gt; \r\n&lt;body&gt; \r\n&lt;pre&gt;\r\nDataFlair\r\nLearn Today.Lead Tomorrow.\r\n&lt;\/pre&gt; \r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-227-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78706\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-227-1.png\" alt=\"html preformatted text\" width=\"334\" height=\"75\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-227-1.png 334w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-227-1-300x67.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-227-1-150x34.png 150w\" sizes=\"auto, (max-width: 334px) 100vw, 334px\" \/><\/a><\/p>\n<h3>11. HTML Definition tag<\/h3>\n<p>As from the name itself, the definition tag is for defining a term that appears for the first time. Its contents are displayed in italics. For example,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;p&gt;&lt;dfn&gt;DataFlair&lt;\/dfn&gt;&lt;br&gt;We continuously work hard to bring you the best trainers to enable your smooth learning at your home as per your convenience. This is the reason why most of the DataFlair students get placed in top MNCs in Big Data just after the training.\r\nDataFlair team comprises of trainers who are experts in their relevant technologies and are selected after many rounds of interviews, content team that continuously works hard to provide quality content to the readers, Marketing team that work hand in hand with other teams to make the content reaches the right audience and HR team that work to extend the team and to provide a healthy work environment.&lt;\/p&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78703\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-12.png\" alt=\"HTML tags\" width=\"1288\" height=\"206\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-12.png 1288w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-12-300x48.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-12-1024x164.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-12-150x24.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-12-768x123.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/pasted-image-0-12-520x83.png 520w\" sizes=\"auto, (max-width: 1288px) 100vw, 1288px\" \/><\/a><\/p>\n<h3>12. HTML Grouping content<\/h3>\n<p>The <strong>&lt;div&gt;<\/strong> and <strong>&lt;span&gt;<\/strong> elements are used to group similar content together and create sections or subsections.<br \/>\nThe &lt;span&gt; element groups inline elements only. For example,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;DataFlair&lt;\/title&gt;\r\n&lt;\/head&gt;    \r\n&lt;body&gt;\r\n&lt;div id = \"menu\" align = \"middle\" &gt;\r\n&lt;a href = \"#\"&gt;HOME&lt;\/a&gt; | \r\n&lt;a href = \"#\"&gt;CONTACT&lt;\/a&gt; | \r\n&lt;a href = \"#\"&gt;ABOUT&lt;\/a&gt;\r\n&lt;\/div&gt;\r\n&lt;p&gt;This is the example of &lt;span&gt;span tag&lt;\/span&gt;\r\n&lt;\/p&gt;\r\n&lt;\/body&gt;   \r\n&lt;\/html&gt;\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-307.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-78696\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-307.png\" alt=\"HTML Grouping\" width=\"1014\" height=\"103\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-307.png 1014w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-307-300x30.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-307-150x15.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-307-768x78.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/Screenshot-307-520x53.png 520w\" sizes=\"auto, (max-width: 1014px) 100vw, 1014px\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>In this article, we\u2019ve looked at the major HTML formatting elements and some content-grouping elements. There\u2019s a clear understanding of the elements such as &lt;h&gt;, &lt;b&gt;, &lt;strong&gt;, &lt;small&gt;, &lt;pre&gt;, &lt;i&gt;, &lt;em&gt;, &lt;sub&gt;, &lt;sup&gt;, &lt;ins&gt;, &lt;dfn&gt;, &lt;del&gt;, &lt;div&gt; and &lt;span&gt;. The &lt;div&gt; and &lt;span&gt; elements will be discussed in detail in the following articles.<\/p>\n<p><strong>Hope you like the article!!!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTML Formatting basically refers to the enhancing of text in order to increase the visual appeal. HTML provides a range of formatting tags that can be used to make the text attractive to the&#46;&#46;&#46;<\/p>\n","protected":false},"author":10,"featured_media":78695,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22400],"tags":[32742,22456,32741,32743,32744],"class_list":["post-78505","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html","tag-formatting-text-in-html","tag-html-formatting","tag-html-formatting-tags","tag-html-headings","tag-html-strong-element"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HTML Formatting - Learn Text Formatting in HTML - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn HTML Text formatting and various tags for HTML formatting - HTML Headings, Strong, Bold, underline, superscript and subscript, Italicized, definition, grouping etc.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/html-formatting\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML Formatting - Learn Text Formatting in HTML - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn HTML Text formatting and various tags for HTML formatting - HTML Headings, Strong, Bold, underline, superscript and subscript, Italicized, definition, grouping etc.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/html-formatting\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-26T03:30:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-26T07:58:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML Formatting - Learn Text Formatting in HTML - DataFlair","description":"Learn HTML Text formatting and various tags for HTML formatting - HTML Headings, Strong, Bold, underline, superscript and subscript, Italicized, definition, grouping etc.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/html-formatting\/","og_locale":"en_US","og_type":"article","og_title":"HTML Formatting - Learn Text Formatting in HTML - DataFlair","og_description":"Learn HTML Text formatting and various tags for HTML formatting - HTML Headings, Strong, Bold, underline, superscript and subscript, Italicized, definition, grouping etc.","og_url":"https:\/\/data-flair.training\/blogs\/html-formatting\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-06-26T03:30:26+00:00","article_modified_time":"2024-07-26T07:58:52+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-1.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/html-formatting\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/html-formatting\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33"},"headline":"HTML Formatting &#8211; Learn Text Formatting in HTML","datePublished":"2020-06-26T03:30:26+00:00","dateModified":"2024-07-26T07:58:52+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/html-formatting\/"},"wordCount":772,"commentCount":2,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/html-formatting\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-1.jpg","keywords":["Formatting Text in HTML","HTML formatting","HTML Formatting Tags","HTML Headings","HTML Strong Element"],"articleSection":["HTML Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/html-formatting\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/html-formatting\/","url":"https:\/\/data-flair.training\/blogs\/html-formatting\/","name":"HTML Formatting - Learn Text Formatting in HTML - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/html-formatting\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/html-formatting\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-1.jpg","datePublished":"2020-06-26T03:30:26+00:00","dateModified":"2024-07-26T07:58:52+00:00","description":"Learn HTML Text formatting and various tags for HTML formatting - HTML Headings, Strong, Bold, underline, superscript and subscript, Italicized, definition, grouping etc.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/html-formatting\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/html-formatting\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/html-formatting\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-1.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/06\/HTML-Text-Formatting-Tags-1.jpg","width":1200,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/html-formatting\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"HTML Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/html\/"},{"@type":"ListItem","position":3,"name":"HTML Formatting &#8211; Learn Text Formatting in HTML"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team is passionate about delivering top-notch tutorials and resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With expertise in the tech industry, we simplify complex topics to help learners excel. Stay updated with our latest insights.","url":"https:\/\/data-flair.training\/blogs\/author\/dfadteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/78505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=78505"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/78505\/revisions"}],"predecessor-version":[{"id":142943,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/78505\/revisions\/142943"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/78695"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=78505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=78505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=78505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}