CSS Questions & Answers – Server Specific CSS

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

1. Which of the following will select all elements within the class?
a) .class
b) #id
c) element
d) element>element
View Answer

Answer: a
Explanation: .class selects all elements within the given class, #id selects the element within the given id, element>element selects all <p> elements where parent is <div> element, element selects all <p> elements.

2. Which of the following selects all <div> elements and all <p> elements?
a) element,element
b) element+element
c) element,element
d) element element
View Answer

Answer: c
Explanation: element,element selects all <div> elements and all <p> elements, element element selects all <p> elements inside <div> elements, element>element selects all <p> elements where parent is a <div> element, element+element selects all <p> elements that are placed immediately after <div> element.

3. Which of the following selects all elements with a target attribute?
a) attribute
b) attribute=value
c) attribute~=value
d) attribute^=value
View Answer

Answer: a
Explanation: attribute selects all elements with a target attribute, attribute=value selects all elements for the given target, attribute~=value selects all elements with a title attribute containing the given title, attribute=value selects all elements with a lang attribute value starting with the given lang.
advertisement
advertisement

4. Which of the following selects every <a> element whose href attribute value contains the given substring?
a) attribute$=value
b) attribute*=value
c) attribute^=value
d) attribute|=value
View Answer

Answer: b
Explanation: attribute*=value selects every <a> element whose href attribute value contains the given substring, attribute$=value selects every <a> element whose href attribute value ends with the given href, attribute^=value selects every <a> element element whose href attribute value begins with “https”.

5. Which of the following selects every <p> element that has no children?
a) :empty
b) :enabled
c) :checked
d) :disabled
View Answer

Answer: a
Explanation: :empty selects every <p> element that has no children including text nodes, :checked selects every checked <input> element, :disabled selects every disabled <input> element, :enabled selects every enabled <input> element.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Which of the following selects input element which has focus?
a) :in-range
b) :hover
c) :focus
d) :invalid
View Answer

Answer: c
Explanation: :focus selects input element which has focus, :hover selects links on mouse hover, :in-range selects input elements with a value within a specified range, :invalid selects all input elements with an invalid value.

7. Which selects all unvisited links?
a) :last-child
b) :not(selector)
c) :link
d) :nth-child(n)
View Answer

Answer: c
Explanation: :link selects all unvisited links, :not(selector) selects every element that is the second child of its parent, :last-child selects every <p> element that is the last child of its parent.
advertisement

8. Which of the following will select every <p> element that is the only child of its parent?
a) :only-child
b) :only-of-type
c) :optional
d) :out-of-range
View Answer

Answer: a
Explanation: :only-child selects every <p> element that is the only child of its parent, :only-of-type selects every <p> element that is the only child of its parent, :optional selects input elements with no “required” attribute.

9. Which selects document’s root element?
a) :required
b) :root
c) ::selection
d) :out-of-range
View Answer

Answer: b
Explanation: :root selects the document’s root element, ::selection selects the portion of an element that is selected by a user, :required selects input elements with “required” attribute specified, :out-of-range selects input elements with a value outside a specified range.
advertisement

10. Which selects all visited links?
a) :valid
b) :visited
c) :target
d) :selection
View Answer

Answer: b
Explanation: :visited selects all visited links, :valid selects all input elements with a valid value, :target selects the current active # element, ::selection selects the portion of an element that is selected by a user.

11. background-blend-mode is not supported by?
a) IE
b) Opera
c) Chrome
d) Firefox
View Answer

Answer: a
Explanation: background-blend-mode is not supported by Internet Explorer, background-clip, background-color, background-image, background-origin, background-position, background, background-repeat, background-size are supported by all the browsers.

12. @font-feature-values are only supported in _______________
a) chrome
b) firefox
c) IE
d) Opera
View Answer

Answer: b
Explanation: @font-feature-values are supported by Firefox only, font-kerning is supported by all the browsers, font-language-override is supported by firefox only, font-varient is supported by all the browsers.

13. A grid is not supported by _______________
a) IE
b) Chrome
c) Opera
d) Firefox
View Answer

Answer: a
Explanation: Grid is not supported by Internet Explorer, grid-area, grid-auto-column, grid-column, grid-column-start, grid-column-end, grid-auto-row, grid-row-gap, grid-row-start is supported by all the browsers.

14. outline-offset is not supported by _______________
a) IE
b) Chrome
c) Opera
d) Firefox
View Answer

Answer: a
Explanation: outline-offset is not supported by Internet Explorer, outline, outline-color, outline-style, outline-width are supported by all the browsers.

15. @page is not supported by _________________
a) chrome
b) opera
c) IE
d) Firefox
View Answer

Answer: a
Explanation: @page is not supported by chrome, page-break-after, page-break-before, page-break-inside, perspective, perspective-origin, pointer-events, position are all supported by all the browsers.

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.