CSS for Web Development

0% completed

Previous
Next
Quiz
Question 1
Given the following CSS, what happens when you click (activate) an element?
button:active {
  background-color: #ff5722;
}
A
The button will change its background color to #ff5722 while being clicked.
B
The button will change its background color to #ff5722 when hovered.
C
The button will maintain the background color #ff5722 permanently after being clicked.
D
The button will not show any change because pseudo-classes cannot alter background colors.
Question 2
Which CSS rule uses a pseudo-element to insert content before an element?
A
.label::after { content: "New!"; }
B
.label::before { content: "New!"; }
C
.label:before { content: "New!"; }
D
.label:hover::before { content: "New!"; }
Question 3
Consider the following HTML. Which CSS rule will insert a dash ("-") before every list item?
<ul class="bullet-list">
  <li>Item A</li>
  <li>Item B</li>
</ul>
A
.bullet-list li::after { content: "-"; }
B
.bullet-list li:before { content: "- "; }
C
.bullet-list li::before { content: "- "; }
D
.bullet-list li:hover::before { content: "- "; }

.....

.....

.....

Like the course? Get enrolled and start learning!
Previous
Next