CSS Questions & Answers – CSS Color Values

This set of CSS Multiple Choice Questions & Answers (MCQs) focuses on “CSS Color Values”.

1. Which of the following CSS3 Color Feature can be used as a macro for whatever the current color is?
a) CurrentColor keyword
b) HSLa Color
c) HSL Color
d) RGB Color
View Answer

Answer: a
Explanation: This is useful if you want to dynamically change one color and have other related colors change.

2. Which of the following CSS3 Color Feature like RGB color but adds an alpha channel value to specify the opacity of the color?
a) RGB
b) RGBa
c) RGBaplha
d) AlphaRGB
View Answer

Answer: b
Explanation: An RGBa is specified via a function style rgba(r,g,b,a) value, where colors r, g, and b are specified as a decimal value from 0 to 255 or a percentage from 0 to 100%, and the alpha channel value for defining opacity is a number between 0 (fully transparent) and 1 (fully opaque). Values outside this range will be rounded up or down to fit the closest value.

3. Which of the following Color Format is a CSS’s six-digit hexadecimal format is the same as color defined in (X)HTML?
a) 6-Hex Color
b) 3-Hex Color
c) RGBS
d) RGBa
View Answer

Answer: a
Explanation: The format specifies color as #rrggbb, where rr is the amount of red, gg the amount of green, and bb the amount of blue, all specified in a hexadecimal value ranging from 00 to FF.
advertisement
advertisement

4. Which of the following Color Format is a CSS2 introduced named color keywords which allows Web page colors to be matched to an operating system’s color use?
a) HSLa Color
b) Commonly defined named colors
c) System Color Names
d) Specificationdefined named colors
View Answer

Answer: c
Explanation: None.

5. Which of the following Color Format are a 17 defined colors under CSS 2.1?
a) HSLa Color
b) Commonly defined named colors
c) System Color Names
d) Specificationdefined named colors
View Answer

Answer: d
Explanation:
maroon (#800000) red (#ff0000)
orange (#ffA500) yellow (#ffff00)
olive (#808000) purple (#800080)
fuchsia (#ff00ff ) white (#ffffff)
lime (#00ff00) green (#008000)
navy (#000080) blue (#0000ff)
aqua (#00ffff) teal (#008080)
black (#000000) silver (#c0c0c0)
gray (#808080)
Other color keywords may be commonly used but are ad hoc in their definition.

6. Which of the following Color Format is a CSS colors can also be defined using the keyword rgb, followed by three numbers between 0 and 255, contained in parentheses and separated by commas, with no spaces between them?
a) RGB Color
b) RGBa Color
c) HSL Color
d) HSLa Color
View Answer

Answer: a
Explanation: RGB color values can also be defined using percentages. The format is the same, except that the numbers are replaced by percentage values between 0% and 100%.

7. Which of the following Color Format is a CSS3 HSL value with a fourth value to set the alpha channel value for the color to define the opacity of the element?
a) RGB Color
b) RGBa Color
c) HSL Color
d) HSLa Color
View Answer

Answer: d
Explanation: None.
advertisement

8. Which of the following Selector selects an element if it’s the only child of its parent with its type?

a) @media
b) :target
c) ::selection
d) :only-of-type
View Answer
Answer: d
Explanation: None.
 
 

9. Which of the following Selector same as :firstline; changed under CSS3 to make pseudoelements obvious?

advertisement
a) :first-letter
b) :last-child
c) :first-line
d) ::first-line
View Answer
Answer: d
Explanation: None.
 
 

10. What does HSL stands for?
a) Hue Specified Lightness
b) Hue Spot Lightness
c) Hue Saturation Lightness
d) None of the mentioned
View Answer

Answer: c
Explanation: None.

Sanfoundry Global Education & Learning Series – CSS.

To practice all areas of CSS, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.