Full Stack Developer Course || Complete HTML Free Course 2023
HTML Text Formatting
HTML text formatting refers to the use of HTML tags to add formatting to text in the HTML document. Here are some common text formatting tags in HTML:
- <b>: Renders the text in bold.
- <strong>: Renders the text in bold and is used to indicate that the text is important.
- <i>: Renders the text in italic.
- <em>: Renders the text in italic and is used to emphasize the text.
- <u>: Underlines the text.
- <mark>: Highlights the text in yellow.
- <sub>: Renders the text as a subscript.
- <sup>: Renders the text as a superscript.
- <small>: Renders the text in a smaller font size.
Here's an example of how to use these tags:
- <p>This is some <b>bold</b> text.</p>
- <p>This is some <strong>important</strong> text.</p>
- <p>This is some <i>italic</i> text.</p>
- <p>This is some <em>emphasized</em> text.</p>
- <p>This is some <u>underlined</u> text.</p>
- <p>This is some <mark>highlighted</mark> text.</p>
- <p>This is some H<sub>2</sub>O.</p>
- <p>This is some E=mc<sup>2</sup>.</p>
- <p>This is some <small>small</small> text.</p>
HTML Quotation and Citation Elements
HTML provides several elements for adding quotes and citations to your web page. These include:
<q>: Renders the text in a short quotation.
<blockquote>: Renders the text in a long quotation that is indented from both sides.
<cite>: Renders the text in a citation style, which is usually italic.
Here's an example of how to use these tags:
<p>He said, <q>I'll be back</q> before disappearing.</p>
<blockquote>
The world is a dangerous place to live; not because of the people who are evil, but because of the people who don't do anything about it.
<cite>Albert Einstein</cite>
</blockquote>
The <cite> element can be used to specify the source of the quote, while the <blockquote> element can be used to specify a longer quotation
HTML Comment Tag
The HTML comment tag is used to add comments to an HTML document. Comments are not displayed in the browser, but they can be helpful for adding notes or explanations to your HTML code.
To add a comment to your HTML code, use the following syntax:
<!-- This is a comment -->
Anything within the <!-- and --> tags will be treated as a comment and ignored by the browser.
Here's an example of how to use the comment tag:
<!-- This is the main content of the page -->
<div>
<h1>Welcome to my website</h1>
<p>Here you will find information about me and my interests.</p>
</div>
<!-- This is the footer of the page -->
<footer>
<p>Copyright 2022</p>
</footer>
Thanks for reading this post,
Subscribe on YouTube : https://youtube.com/shorts/OuPJ1FY0Q9I?feature=share
1 Comments
Any Doubts ??
ReplyDelete