CSS for Web Development

0% completed

Previous
Next
Quiz
Question 1
Consider the following CSS rule. What is the effect on the
element?
div {
  width: 50%;
}
A
The <div> will occupy 50% of the viewport’s width.
B
The <div> will have a fixed width of 50 pixels.
C
The <div> will occupy 50% of its parent element’s width.
D
The <div> will not be visible because 50% is too small.
Question 2
Which CSS property would you use to create space outside the border of an element?
A
padding
B
margin
C
border-spacing
D
spacing
Question 3
Given the HTML below, which CSS rule will add 20px of padding to all sides of the .box element?
<div class="box">
  Content goes here.
</div>
A
.box { padding: 20px; }
B
.box { padding: 20; }
C
.box { margin: 20px; }
D
.box { padding: 20px 10px; }

.....

.....

.....

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