Lesson 11:HTML-Text attribute
- Sunday, February 8, 2009, 9:02
- Programming
- 715 views
- Add a comment
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
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
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
About the Author
Related Tutorials & Articles
The bgcolor attribute control the background color of the page. Bgcolor can be used with several html tags but here our keen focus on <body> background color. The value of background attribute can be set in plain text or in hexadecimal numbers, all background colors are the mix of RGB(red,green,blue) colors. Each colors value can...Read more
The background attribute allows you to place image or picture on background of your page. The background is most commonly used attribute of <body>,<table> element. When background tag within body tag it repeat the image to fill whole web page background.It’s a good practice to use small size images because huge size image take time...Read more
HTML is capable to embed images in a webpage; it can be done by using html tag <img>. Image tag is not a container tag means there is no closing tag but it has several attributes. Tag Syntax <img src=”picpath” height=”10” width=”20” alt=”image description” align=> Src Src attribute of image tag defines source of image, src is always set...Read more
Font tag in html is used for formatting the text. Font tag comprise three attributes font size, face and color, you can play with these attributes to change the looks of your site text. Font Size This attribute can increase and decrease the font size, smallest value of size attribute can be set as 1 and the...Read more
In lesson 1 we have seen that head and body portion contents are shown together on body part of the document. In this tutorials we will see how to use the title tag to show the head part separate from the body part. Let me show you the document which were used in lesson 1 for...Read more
Write a Comment
Gravatars are small images that can show your personality. You can get your gravatar for free today!























