2. YOU CAN SET UP HTML STYLE OF AN
HTML ELEMENT WITH THE style ATTRIBUTE
The HTML style attribute has following syntax :
< tagname style=“ property: value; ">
The property is a CSS property. The value is a CSS value.
Example : -
< p style=“ color : red; "> Red </p>
RED
3. HTML Background Color
<!DOCTYPE html>
<html>
<body style="background-color:grey;">
<h1>HTML</h1>
<p>HTML is a markup language.</p>
</body>
</html>
The background-color property defines the
background color for an HTML element.
4. HTML Text Color
<!DOCTYPE html>
<html>
<body style="background-color:grey;">
<h1 style=“color : blue;”>HTML</h1>
<p style = “color : red;”>HTML is a markup
language.</p>
</body>
</html>
The text-color property defines the text color for an
HTML element.
5. HTML Text Alignment
<!DOCTYPE html>
<html>
<body style="background-color:grey;">
<h1 style = “text-align : left;”>Left Aligned Text</h1>
<h1 style = “text-align : right;”>Right Aligned Text </h1>
<h1 style = “text-align : center;”>Center Aligned Text</h1>
</body>
</html>
The text-align property defines the horizontal text
alignment for an HTML element.
6. HTML Text Size
<!DOCTYPE html>
<html>
<body style="background-color:grey;">
<h1 style = “font-size: 200%;”>Text</h1>
<h1 style = “font-size: 20px;”>Text </h1>
<h1 style = “font-size: 42pts;”> Text</h1>
</body>
</html>
The font-size property defines the text size for an
HTML element.
7. HTML Fonts
Decorative Feet of the letters
Small Lines that are seen trailing
out of the edges of the letters
Serif Fonts are readable in print;
therefore, they are loved by newspapers
and magazines.
Examples : Times New Roman ,
Rockwell , Goudy Stout
8. HTML Fonts
Does not have the trail or lines
emanating from the edges of the
letters and alphabets.
Non- flourished and the letters
seem to be simple and rounded
Sans typeface is clean and makes
for a good readability on the
internet
Examples :- Verdana, Arial,
Tahoma