Background Color
background-color property-யைப் பயன்படுத்தி text-க்கு background color கொடுக்க முடியும்.
Output:
விளக்கம்:-
இந்த program-ல் body tag-யை select செய்து அதனுடைய background color-யை light grey நிறமாகவும் அதனுடைய text color-யை blue நிறமாகவும் மாற்றம் செய்யப்பட்டுள்ளது.
Output:
விளக்கம்:-
h1 என்கிற element-யை select செய்யப்பட்டு அதனுடைய background color-யை கறுப்பு நிறமாகவும், அதனுடைய text color-யை வெள்ளை நிறமாகவும் மாற்றப்படுகிறது.
background-color property-யைப் பயன்படுத்தி text-க்கு background color கொடுக்க முடியும்.
Example 1:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: lightgrey;
color: blue;
}
</style>
</head>
<body>
<h1>I Love CSS.</h1>
</body>
</html>
Output:
விளக்கம்:-
இந்த program-ல் body tag-யை select செய்து அதனுடைய background color-யை light grey நிறமாகவும் அதனுடைய text color-யை blue நிறமாகவும் மாற்றம் செய்யப்பட்டுள்ளது.
Example 2:
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
background-color: black;
color: white;
}
</style>
</head>
<body>
<h1>I Love Program.</h1>
</body>
</html>
Output:
விளக்கம்:-
h1 என்கிற element-யை select செய்யப்பட்டு அதனுடைய background color-யை கறுப்பு நிறமாகவும், அதனுடைய text color-யை வெள்ளை நிறமாகவும் மாற்றப்படுகிறது.
No comments:
Post a Comment