CSS for Web Development

0% completed

Previous
Next
Quiz
Question 1
What does the following CSS rule select?
p {
  color: blue;
}
A
All <p> elements on the page
B
Only the first <p> element on the page
C
Only <p> elements with a class "blue"
D
All elements with the tag name "p" inside a <div>
Question 2
Examine the following CSS. Which element is targeted by the rule?
#banner {
  background-color: #ffeb3b;
}
A
An element with class "banner"
B
An element with the attribute id="banner"
C
All <banner> elements
D
All elements that contain the text "banner"
Question 3
What is the result of the following selector:
h2, p {
  margin: 10px;
}
A
Only <h2> elements get a margin of 10px.
B
Only <p> elements get a margin of 10px.
C
Both <h2> and <p> elements get a margin of 10px.
D
t produces a syntax error.
Question 4
What does the following code do?
p.warning {
  color: red;
}
A
It styles all <p> elements with the class "warning" to have red text.
B
It styles all elements with the class "warning" to have red text.
C
It styles a custom element <p.warning>.
D
It applies red color to the background of the paragraph.

.....

.....

.....

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