CSS Multiple Choice Questions & Answers on Using Advanced Selectors for Freshers

1.Which of the following selector selects all elements of E that have the attribute attr that end with the given value?

a) E[attr^=value]
b) E[attr$=value]
c) E[attr*=value]
d) none of the mentioned

Answer: b

Explanation:
Example: p[title$="!"] {color: red;}
 
 
2. Which of the following selector selects the elements that are checked?
a) E ~ F
b) ::after
c) :checked
d) none of the mentioned

Answer: c

Explanation:
Example: :checked {color: blue;}
 
 
3. Which of the following selector selects the elements that are the default among a set of similar elements?
a) :default
b) :%
c) :disabled
d) none of the mentioned

Answer: a

Explanation:
Example: :default {background-color: red;}
 
 
4. Which of the following selector selects an element that has no children?
a) :empty
b) :nochild
c) :inheritance
d) :no-child

Answer: a

Explanation: None.
 
 
5. Which of the following selector selects the elements that are currently enabled?
a) :element
b) :empty
c) :enabled
d) none of the mentioned

Answer: c

Explanation:
Example: input:enabled {background-color:white;}
 
 
6. Which of the following selector selects the element that is the first child of its parent that is of its type?
a) :first-of-type
b) :last-child
c) ::first-line
d) ::first-letter

Answer: a

Explanation:
Example: strong:first-of-type {font-size:bigger;}
 
 
7. Which of the following selector selects elements that do not match the selector s?
a) :!(s)
b) :nth-child(s)
c) :not(s)
d) none of the mentioned

Answer: c

Explanation:
Example: *:not(h1) {color: black;}
 
 
8. Which of the following selector selects an element if it’s the only child of its parent?
a) :root
b) :nth-oftype(n)
c) :only-child
d) none of the mentioned

Answer: c

Explanation:
Example: h1:only-child {color: blue;}
 
 
9. Which of the following selector selects the element that is the target of a referring URI?
a) :target
b) :selection
c) ::selection
d) :URI

Answer: a

Explanation:
Example: :target{color:red;}
 
 
10. Which of the following selector applies styles to elements that are valid per HTML5 validations set either with the pattern or type
attributes?

a) :valid
b) :required
c) :optional
d) :invalid

Answer: a

Explanation:
Example: :valid {color: green;}

Related

Java Multiple Choice Questions & Answers on Java.util package BitSet & Date class for Freshers

1. Which of these class object has architecture similar to that of array? a) Bitsetb) Mapc) Hashtabled) All if the mentioned Answer: a Explanation: Bitset class creates a special type of array th...

C Programming Questions and Answers on Structures and Functions for Freshers

1. What is the output of this C code? #include struct student { char *name; }; struct student s; struct student fun(void) { s.name = "new...

CSS Multiple Choice Questions & Answers on Styling Tables for Freshers

1. Which of the following element is used within the table element to define a caption? a) b) <caption> c) d) Answer: b  2. Which of the following property is used ...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item