Text Color
Color property-யைப் பயன்படுத்தி text-க்கு color கொடுக்க முடியும்.
Output:
விளக்கம்:-
h1 -> இங்கு h1 என்பது selector ஆகும்.
color:red; -> இது h1 இல் இருக்கின்ற content-ன் உடைய text color-யை சிவப்பு நிறமாக(Red Color) மாற்றுகிறது.
Output:
விளக்கம்:-
color:green; -> இது body tag-ன் உள்ளே இருக்கின்ற அனைத்து content-ன் உடைய text color-யையும் பச்சை நிறமாக மாற்றுகிறது.
Output:
விளக்கம்:-
இந்த program-ல் h1 மற்றும் p என்கிற இரண்டு element-கள் பயன்படுத்தப்பட்டுள்ளது.இதில் p tag-ன் உள்ளே இருக்கின்ற content-ன் உடைய text color-யை சிவப்பு நிறமாக மாற்றப்படுகிறது.
Color property-யைப் பயன்படுத்தி text-க்கு color கொடுக்க முடியும்.
Example 1:
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: red;
}
</style>
</head>
<body>
<h1>Color Property </h1>
</body>
</html>
Output:
விளக்கம்:-
h1 -> இங்கு h1 என்பது selector ஆகும்.
color:red; -> இது h1 இல் இருக்கின்ற content-ன் உடைய text color-யை சிவப்பு நிறமாக(Red Color) மாற்றுகிறது.
Example 2:
<!DOCTYPE html>
<html>
<head>
<style>
body {
color: green;
}
</style>
</head>
<body>
<h1>Color Property </h1>
<p>Color property-யைப் பயன்படுத்தி text-க்கு color கொடுக்க முடியும்.</p>
</body>
</html>
Output:
விளக்கம்:-
color:green; -> இது body tag-ன் உள்ளே இருக்கின்ற அனைத்து content-ன் உடைய text color-யையும் பச்சை நிறமாக மாற்றுகிறது.
Example 3:
<!DOCTYPE html>
<html>
<head>
<style>
p {
color: red;
}
</style>
</head>
<body>
<h1>Color Property </h1>
<p>Color property-யைப் பயன்படுத்தி text-க்கு color கொடுக்க முடியும்.</p>
</body>
</html>
Output:
விளக்கம்:-
இந்த program-ல் h1 மற்றும் p என்கிற இரண்டு element-கள் பயன்படுத்தப்பட்டுள்ளது.இதில் p tag-ன் உள்ளே இருக்கின்ற content-ன் உடைய text color-யை சிவப்பு நிறமாக மாற்றப்படுகிறது.
No comments:
Post a Comment