HTML text formatting involves using HTML tags to define the appearance and structure of text on a webpage. Here are some commonly used HTML tags for text formatting:
- Bold Text: <b> or <strong>
<b>This text is bold.</b>
<strong>This text is strong and bold.</strong>
2. Italic Text: <i> or <em>
<i>This text is italic.</i>
<em>This text is emphasized and italic.</em>
3. Underlined Text: <u>
<u>This text is underlined.</u>
4. del Text: <del>
<del>This text is deleted.</del>
5. Marked Text: <mark>
<mark>This text is highlighted.</mark>
6. Small Text: <small>
<small>This text is small.</small>
7. Subscript Text: <sub>
H<sub>2</sub>O
8. Superscript Text: <sup>
E = mc<sup>2</sup>
HTML Text formatting – Interview Questions
Q 1: Which tag makes text bold?
Ans: or .
Q 2: Which tag italicizes text?
Ans: or .
Q 3: Which tag underlines text?
Ans: .
Q 4: Difference between and ?
Ans: has semantic importance.
Q 5: Which tag highlights text?
Ans: .
HTML Text formatting – Objective Questions (MCQs)
Q1. Which attribute is used to apply inline styles in HTML?
Q2. Which tag is used to italicize text?
Q3. Which tag is used to create a subscript in HTML?
Q4. Which tag is used to create superscript text?
Q5. Which tag is used for marking text as deleted or strikethrough?