Web Development MCQs

100 MCQs  (Page 4 of 10)

What is the difference between :hover and ::before?
:hover is a pseudo-class (a state); ::before is a pseudo-element (generated content)
Both are pseudo-elements
Both are pseudo-classes
::before is a state
Two rules with identical specificity set different colors on the same element. Which one applies?
The darker color
The rule that appears later in the cascade (source order)
Neither; it is an error
The first rule
What does 100vh mean?
100% of the viewport's height
The height of 100 lines
100% of the parent's height
100 virtual pixels
What is the difference between a CSS transition and a CSS animation?
They are identical
Transitions use @keyframes
Animations require JavaScript
A transition animates between two states when a property changes; an animation runs keyframes that can loop without any trigger
What are SASS and LESS?
Browser engines
CSS validators
JavaScript frameworks
CSS preprocessors that add variables, nesting, and mixins, and compile to plain CSS