Lesson 11:HTML-Text attribute

As we learn in our last lesson about background color and background image. Text color in page remain the same whatever background color or background image you have used. If you use dark background colors and images then most probably it’s difficult for page viewer to read anything. Text is useful attribute of <body> tag to change the text color of complete page except anchor text(page links), text attribute must be set equal to color.

Color can be represented with color name(blue,black,red etc) or in hexadecimal (#0000000 – #FFFFFF).

Text attribute Formats

<body text=”red”>

Text attribute with no background color and background image.

<body bgcolor=”black” text=”white”>

Text color set to white with black background color

<body background=”a.jpg” text=”white”>

Text color set to white with background image.

<body background=”a.jpg” text=”FFFFFF”>

Text color set in hexadecimal to white with background image.

HTML Code

<HTML>

<HEAD>

Text attribute without background and bgcolor

</HEAD>

<BODY text=”blue”>

Here is the body part

</BODY>

</HTML>

Output

image 

HTML Code

<HTML>

<HEAD>

Text attribute with black bgcolor and no background image

</HEAD>

<BODY text=”blue”>

Here is the body part

</BODY>

</HTML>

Output

image

 HTML Code

<html>
<head>
<title>
Text color with background image
</title>
</head>
<body text=”red” background=”
a.jpg”>
<h1>Check the Background image</h1>
</body>
</html>

Output

image

Be Sociable, Share!

Leave a Reply