Chapter 3 - HTML Basic Elements PDF
Chapter 3 - HTML Basic Elements PDF
VILCHOR G. PERDIDO
(Course Instructor)
1
Lesson 3.1: Basic Tags
Headings LAB
WebDev
2
Headings LAB
WebDev
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
Paragraphs LAB
WebDev
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
3
Paragraphs LAB
WebDev
Line Breaks
• The HTML <br> element defines a line break.
• Use <br> if you want a line break (a new line)
without starting a new paragraph:
Paragraphs LAB
WebDev
4
Paragraphs LAB
WebDev
<pre>
My Bonnie lies over the ocean.
<tagname style="property:value;">
5
Applying style Attribute LAB
WebDev
Background Color
• The background-color property defines the
background color for an HTML element.
• This example sets the background color for a
page to powderblue:
Example LAB
WebDev
<body style="background-color:
powderblue;">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
6
Output LAB
WebDev
Text Color
• The color property defines the text color for an
HTML element:
7
Output LAB
WebDev
Fonts
• The font-family property defines the font to be
used for an HTML element:
<h1 style="font-family:verdana;">This is a heading</h1>
<p style="font-family:courier;">This is a paragraph.</p>
8
Output LAB
WebDev
Text Size
• The font-size property defines the text size for
an HTML element:
9
Output LAB
WebDev
Text Alignment
• The text-align property defines the horizontal
text alignment for an HTML element:
10
Output LAB
WebDev
Summary LAB
WebDev
11
Lesson 3.2: Text Formatting
12
Text Formatting LAB
WebDev
13
Text Formatting LAB
WebDev
<small> Element
• The HTML <small> element defines smaller
text:
<mark> Element
• The HTML <mark> element defines marked or
highlighted text:
<h2>HTML <mark>Marked</mark> Formatting</h2>
14
Text Formatting LAB
WebDev
<del> Element
• The HTML <del> element defines deleted
(removed) text.
<p>My favorite color is <del>blue</del> red.</p>
<ins> Element
• The HTML <ins> element defines inserted
(added) text.
15
Text Formatting LAB
WebDev
<sub> Element
• The HTML <sub> element defines subscripted
text.
<p>This is <sub>subscripted</sub> text.</p>
<sup> Element
• The HTML <sup> element defines superscripted
text.
<p>This is <sup>superscripted</sup> text.</p>
16
Lesson 3.3: Quotation and Citation
<q> Element
17
Quotation and Citation Elements LAB
WebDev
18
Quotation and Citation Elements LAB
WebDev
19
Quotation and Citation Elements LAB
WebDev
20
Quotation and Citation Elements LAB
WebDev
<address>
Written by John Doe.<br>
Visit us at:<br>
Example.com<br>
Box 564, Disneyland<br>
USA
</address>
21
Quotation and Citation Elements LAB
WebDev
22
Quotation and Citation Elements LAB
WebDev
23
Quotation and Citation Elements LAB
WebDev
24
HTML Colors LAB
WebDev
25
HTML Colors LAB
WebDev
Color Names
• In HTML, a color can be specified by using a
color name:
<h1 style="background-
color:DodgerBlue;">Hello World</h1>
<p style="background-color:Tomato;">Lorem
ipsum...</p>
26
HTML Colors LAB
WebDev
Color Values
• In HTML, colors can also be specified using RGB
values, HEX values, HSL values, RGBA values, and
HSLA values:
rgb(255, 99, 71)
#ff6347
hsl(9, 100%, 64%)
rgba(255, 99, 71, 0.5)
hsla(9, 100%, 64%, 0.5)
27
HTML Colors LAB
WebDev
RGB Value
• In HTML, a color can be specified as an RGB
value, using this formula:
rgb(red, green, blue)
• Each parameter (red, green, and blue) defines
the intensity of the color between 0 and 255.
28
HTML Colors LAB
WebDev
HEX Value
• In HTML, a color can be specified using a
hexadecimal value in the form:
#rrggbb
• Where rr (red), gg (green) and bb (blue) are
hexadecimal values between 00 and ff (same
as decimal 0-255).
29
HTML Colors LAB
WebDev
HSL Value
• In HTML, a color can be specified using hue,
saturation, and lightness (HSL) in the form:
hsl(hue, saturation, lightness)
30
HTML Colors LAB
WebDev
RGBA Value
• RGBA color values are an extension of RGB
color values with an alpha channel - which
specifies the opacity for a color.
• An RGBA color value is specified with:
rgba(red, green, blue, alpha)
31
HTML Colors LAB
WebDev
HSLA Value
• HSLA color values are an extension of HSL
color values with an alpha channel - which
specifies the opacity for a color.
• An HSLA color value is specified with:
hsla(hue, saturation, lightness, alpha)
32
HTML Colors LAB
WebDev
THE END
33