Using Style Attribute in HTML and its properties

WilhelMinaGone 30 views 10 slides Feb 12, 2024
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

Using Style Attribute in HTML


Slide Content

Styles

HTML Styles

The HTML style attribute is used
to add styles to an element, such
as color, font, size, and more.

Style Attribute
Syntax:
<tagname style="property:value;">

Background Color
The CSS background-color
property defines the background
color for an HTML element.
<body style="background-color:orange;">
<tagname style="property:value;">

Background color for two different
elements
<h1 style="background-color:cornflowerblue;">Lyceum of Alabang</h1>
<p style="background-color:gold;">School Year 2020-2021</p>

Text Color
The CSS color property defines
the text color for an HTML
element.
<h1 style="color:blue;">Lyceum of Alabang</h1>
<p style="color:green;">School Year 2020-2021</p>

Fonts
The CSS font-family property
defines the font to be used for an
HTML element.
<h1 style="font-family:century gothic;">Lyceum of Alabang</h1>
<p style="font-family:arial;">School Year 2020-2021</p>

Text Size
The CSS font-size property
defines the text size for an HTML
element.
<h1 style="font-size:100px;">Lyceum of Alabang</h1>
<p style="font-size:25px;">School Year 2020-2021</p>

Text Alignment
The CSS text-align property
defines the horizontal text
alignment for an HTML element.
<h1 style="text-align:center;">Lyceum of Alabang</h1>
<p style="text-align:center;">School Year 2020-2021</p>
Tags