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

Which CSS property controls the text size?

2

What are the correct CSS syntax for making all the <p> elements bold?

3

How do you display hyperlinks without an underline?

4

How do you make each word in a text start with a capital letter?

5

Which property is used to change the font of an element?

Comments