CSS Multiple choices


Total available count: 25
Subject - Web Development
Subsubject - CSS

Which CSS property is used to change the text color of an element?


 

 

 

 



B


Solution:-

Text/Font Color:-

  1. Text-color property is used to set the color of the text
  2. Text-color can be set by using the name “Yellow”, hex value “##FFFF00” or by its RGB value“rgb(255, 255, 0)

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>

 




Next 5 multiple choice(s)

1

How do you add a background color for all <h1> elements?

2

Which property is used to change the background color?

3

How do you insert a comment in a CSS file?

4

Which is the correct CSS syntax?

5

Which HTML attribute is used to define inline styles?

Comments