Challenge
Moving on to a challenge that deals with using the properties we have learned, which includes box-model properties and font-styling properties.
Note
You can write the code in the
styles.css
file of the following sandbox. To see the rendered page, drag it from the right edge of a sandbox window.
Task
-
For the whole body, set the
font-size
to16px
, line-height to1.2
and font-family tosans-serif
using shorthand. -
For h1 set the text size to
32px
, the font's variant tosmall-caps
, and the line's height to1.5
. -
Style the class
styleMe
as:text-indent
to10px
;font-size
to20px
;color
toblack
.
-
Style the list-items to have a
word-spacing
of5px
and make the text bolder. -
Write a selector that targets a class
favoriteThings
. Style it with the rules:- Set the width to
500px
; - Add
10px
of top margin; - Add
30px
of padding from all sides - Add the
solid
orange
left border of the5px
width . Note! To add a border only to the left side, use the propertyborder-left
the same way you would use theborder
.
- Set the width to
-
Write a rule to select all paragraphs with the class
description
and set the margin top and bottom to 10px using the shorthand. -
Set the position to
absolute
, shift it350px
from the left, and set the height to100px
.
Here is the result you should get. If you are having problems, you can drag the code part with a solution from the left edge of the sandbox window.
Tak for dine kommentarer!
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Awesome!
Completion rate improved to 5
Challenge
Stryg for at vise menuen
Moving on to a challenge that deals with using the properties we have learned, which includes box-model properties and font-styling properties.
Note
You can write the code in the
styles.css
file of the following sandbox. To see the rendered page, drag it from the right edge of a sandbox window.
Task
-
For the whole body, set the
font-size
to16px
, line-height to1.2
and font-family tosans-serif
using shorthand. -
For h1 set the text size to
32px
, the font's variant tosmall-caps
, and the line's height to1.5
. -
Style the class
styleMe
as:text-indent
to10px
;font-size
to20px
;color
toblack
.
-
Style the list-items to have a
word-spacing
of5px
and make the text bolder. -
Write a selector that targets a class
favoriteThings
. Style it with the rules:- Set the width to
500px
; - Add
10px
of top margin; - Add
30px
of padding from all sides - Add the
solid
orange
left border of the5px
width . Note! To add a border only to the left side, use the propertyborder-left
the same way you would use theborder
.
- Set the width to
-
Write a rule to select all paragraphs with the class
description
and set the margin top and bottom to 10px using the shorthand. -
Set the position to
absolute
, shift it350px
from the left, and set the height to100px
.
Here is the result you should get. If you are having problems, you can drag the code part with a solution from the left edge of the sandbox window.
Tak for dine kommentarer!