All Exams  >   Class 6  >   CSS for Beginners  >   All Questions

All questions of CSS Basics - 5 for Class 6 Exam

Which of the following function converts an element’s color to a shade of gray, for use by the filter property?
  • a)
    shade()
  • b)
    grayscale()
  • c)
    black()
  • d)
    brightness()
Correct answer is option 'B'. Can you explain this answer?

Juhi Kumar answered
Understanding the Grayscale Function
The function that converts an element's color to a shade of gray is known as `grayscale()`. This function is primarily used in CSS with the `filter` property.
What is `grayscale()`?
- The `grayscale()` function is part of the CSS Filter Effects Module.
- It allows developers to manipulate the color of an image or element, transforming it into varying shades of gray.
How Does It Work?
- When you apply `grayscale(value)` to an element, the `value` can range from 0% to 100%.
- 0% means no change, keeping the original color.
- 100% turns the element completely gray, removing all color saturation.
Example of Usage
- Here is a simple example of how you can use `grayscale` in CSS:
css
img {
filter: grayscale(100%);
}
- In this case, the image will appear entirely in shades of gray.
Why Choose `grayscale()`?
- This function is widely used in web design for various purposes:
- Focus on Content: It helps to draw attention to specific elements by muting others.
- Aesthetic Appeal: Grayscale images can enhance the overall design and create a classic look.
Conclusion
In summary, the correct answer to your question is option 'B', `grayscale()`, because it specifically converts colors into shades of gray using the CSS filter property. This function is invaluable for designers aiming to achieve a specific visual effect on web pages.

Which of the following function adjusts the difference between light and dark values, for use by the filter property?
  • a)
    contrast()
  • b)
    dark()
  • c)
    light()
  • d)
    brightness()
Correct answer is option 'A'. Can you explain this answer?

Aditya Shah answered
A value of 100% or a decimal value of 1 leaves the image as is, while 0 results in black. Increasing the value past 1 or 100% produces more dramatically stratified areas of light and dark.

Which of the following function adjust the brightness of an element’s color, for use by the filter property?
  • a)
    contrast()
  • b)
    dark()
  • c)
    light()
  • d)
    brightness()
Correct answer is option 'D'. Can you explain this answer?

Aditi Sharma answered
A value of 100% or decimal value of 1 leaves the image as is, while 0 produces black. Increasing the value from 1 or 100% brightens pixels from their original values.

Which of the following element is used by the filter property to blur the images?
  • a)
    opaque()
  • b)
    scatter()
  • c)
    blur()
  • d)
    all of the mentioned
Correct answer is option 'C'. Can you explain this answer?

Aditya Shah answered
Blurs an element, for use by the filter property. Accepts a distance measurement within which pixels are randomly scattered. A value of 0 leaves the image as is.

Chapter doubts & questions for CSS Basics - 5 - CSS for Beginners 2025 is part of Class 6 exam preparation. The chapters have been prepared according to the Class 6 exam syllabus. The Chapter doubts & questions, notes, tests & MCQs are made for Class 6 2025 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests here.

Chapter doubts & questions of CSS Basics - 5 - CSS for Beginners in English & Hindi are available as part of Class 6 exam. Download more important topics, notes, lectures and mock test series for Class 6 Exam by signing up for free.

CSS for Beginners

10 videos|41 docs|23 tests

Signup to see your scores go up within 7 days!

Study with 1000+ FREE Docs, Videos & Tests
10M+ students study on EduRev