<h1> to <h6>
)HTML provides six levels of headings. These are used to define headings and subheadings in your content.
<h1>Main Heading (h1)</h1> <h2>Subheading Level 2 (h2)</h2> <h3>Subheading Level 3 (h3)</h3> <h4>Subheading Level 4 (h4)</h4> <h5>Subheading Level 5 (h5)</h5> <h6>Subheading Level 6 (h6)</h6>
<p>
)The <p>
tag is used to define paragraphs of text. It automatically adds space between paragraphs.
<p>This is the first paragraph of text.</p> <p>This is the second paragraph of text.</p>
This is the first paragraph of text.
This is the second paragraph of text.
<br>
)The <br>
tag is used to insert a line break within text. It doesn't start a new paragraph.
<p>This is some text.<br>This text appears on a new line, but it is still within the same paragraph.</p>
This is some text.
This text appears on a new line, but it is still within the same paragraph.
<pre>
)The <pre>
tag preserves whitespace and line breaks, displaying the text exactly as it is in the HTML code.
<pre> This is preformatted text. It preserves spaces and line breaks. </pre>
This is preformatted text. It preserves spaces and line breaks.
<ul>
)The <ul>
tag creates an unordered (bulleted) list, with each list item defined by the <li>
tag.
<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>
<ol>
)The <ol>
tag creates an ordered (numbered) list, with each item defined by the <li>
tag.
<ol> <li>First item</li> <li>Second item</li> <li>Third item</li> </ol>
You can align text using inline CSS with the text-align
property.
<p style="text-align: left;">This text is aligned to the left.</p> <p style="text-align: center;">This text is centered.</p> <p style="text-align: right;">This text is aligned to the right.</p>
This text is aligned to the left.
This text is centered.
This text is aligned to the right.
The <center>
tag was used to center content in older versions of HTML, but it is deprecated in HTML5. Use CSS instead.
<center>This text is centered using the deprecated <center> tag.</center>
<b>, <strong>
)The <b>
tag makes text bold, while <strong>
indicates importance.
<b>This text is bold using the <b> tag.</b><br> <strong>This text is bold using the <strong> tag, and it's also important.</strong>
<i>, <em>
)The <i>
tag italicizes text, while <em>
emphasizes the text (often italicized).
<i>This text is italicized using the <i> tag.</i><br> <em>This text is emphasized and italicized using the <em> tag.</em>
<sub>, <sup>
)The <sub>
tag is used for subscript text, and <sup>
is used for superscript text.
<p>Water formula: H<sub>2</sub>O</p> <p>Exponential notation: 10<sup>2</sup> = 100</p>
Water formula: H2O
Exponential notation: 102 = 100
<u>
)The <u>
tag is used to underline text.
<u>This text is underlined using the <u> tag.</u>
<s>
)The <s>
tag is used to represent text that has been struck through.
<s>This text has been struck through using the <s> tag.</s>