4 - HTML Text Formatting and Styles
4 - HTML Text Formatting and Styles
Lecture No. 4
Neha Garg
Assistant Professor, CSA/SOET
Outlines
• Prerequisite of topic
• Problem Objective
• HTML Text Formatting
• HTML Attributes
• Assignment
• Learning Outcomes
• Course Outcome (CO)
• Program Outcome (PO)
• References
Prerequisite of topic
• Students should have knowledge about the basics of HTML.
Problem Objective
• The objective of this lecture is to give knowledge about the HTML
Text formatting and Text styling.
HTML Text Formatting
• Tags for the text styles add the distinction to certain characters of the
text. HTML also defines special elements for defining text with a special
meaning.
<b> - Bold text
<strong> - Important text
<i> - Italic text
<em> - Emphasized text
<mark> - Marked text
<small> - Smaller text
<del> - Deleted text
<ins> - Inserted text
<sub> - Subscript text
<sup> - Superscript text
Reference No.: R1, R2
Core Attributes
• The four core attributes that can be used on the majority of HTML
elements (although not all) are −
Id
Title
Class
Style
<tagname style="property:value;">
<body>
<h1 style="background-color:powderblue;">This is a heading</h1>
<p style="background-color:tomato;">This is a paragraph.</p>
</body>
• Text Color:
<h1 style="color:blue;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>
• Text Size:
<h1 style="font-size:300%;">This is a heading</h1>
<p style="font-size:160%;">This is a paragraph.</p>
• Text Alignment:
<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>
Q-2 Which of the following property sets the size of the font?
a) font-size
b) font-variant
c) font-style
d) font-weight
Learning Outcomes
Students learn the following outcomes:
PO12. Life-long learning: Recognize the need for, and have the
preparation and ability to engage in independent and life-long learning in
the broadest context of technological change.
References
1. John Duckett; Beginning HTML, XHTML, CSS, and JavaScript; Wrox
(Wiley).
2. N.P. Gopalan, J. Akilandeswari; Web Technology: A Developer’s
Perspective; Prentice Hall of India.
3. Ivan Bayross; Web Enabled Commercial Applications Development
using HTML, DHTML, JavaScript, Perl CGI; BPB Publication.