Test Series - css

Test Number 54/59

Q: Which of the following will select all elements within the class?
A. .class
B. #id
C. element
D. element>element
Solution: .class selects all elements within the given class, #id selects the element within the given id, element>element selects all 

elements where parent is

element, element selects all

elements.

Q: Which of the following selects all 
elements and all

elements?

A. element,element
B. element+element
C. element,element
D. element element
Solution: element,element selects all 
elements and all

elements, element element selects all

elements inside

elements, element>element selects all

elements where parent is a

element, element+element selects all

elements that are placed immediately after

element.
Q: Which of the following selects all elements with a target attribute?
A. attribute
B. attribute=value
C. attribute~=value
D. attribute^=value
Solution: 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.
Q: Which of the following selects every  element whose href attribute value contains the given substring?
A. attribute$=value
B. attribute*=value
C. attribute^=value
D. attribute|=value
Solution: attribute*=value selects every  element whose href attribute value contains the given substring, attribute$=value selects every  element whose href attribute value ends with the given href, attribute^=value selects every  element element whose href attribute value begins with “https”.
Q: Which of the following selects every 

element that has no children?

A. :empty
B. :enabled
C. :checked
D. :disabled
Solution: :empty selects every 

element that has no children including text nodes, :checked selects every checked element, :disabled selects every disabled element, :enabled selects every enabled element.

Q: Which of the following selects input element which has focus?
A. :in-range
B. :hover
C. :focus
D. :invalid
Solution: :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.
Q: Which selects all unvisited links?
A. :last-child
B. :not(selector)
C. :link
D. :nth-child(n)
Solution: link selects all unvisited links, :not(selector) selects every element that is the second child of its parent, :last-child selects every 

element that is the last child of its parent.

Q: Which of the following will select every 

element that is the only child of its parent?

A. :only-child
B. :only-of-type
C. :optional
D. :out-of-range
Solution: only-child selects every 

element that is the only child of its parent, :only-of-type selects every

element that is the only child of its parent, :optional selects input elements with no “required” attribute.

Q: Which selects document’s root element?
A. :required
B. :root
C. ::selection
D. :out-of-range
Solution: 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.
Q: Which selects all visited links?
A. :valid
B. :visited
C. :target
D. :selection
Solution: 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.

You Have Score    /10