Which CSS property is used to change the text color of an element?
Text/Font Color:-
Syntax to change the text color:
body
{
color:color-name;
}
The example below shows how to change the color of the text,
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color:Yellow;
}
h2
{
color:Red;
}
</style>
</head>
<body>
<h1>
SlightBook
</h1>
<h2>
Online Learning
</h2>
</body>
</html>
How do you add a background color for all <h1> elements?
Which property is used to change the background color?
How do you insert a comment in a CSS file?
Which is the correct CSS syntax?
Which HTML attribute is used to define inline styles?