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.cssfile 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-sizeto16px, line-height to1.2and font-family tosans-serifusing 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
styleMeas:text-indentto10px;font-sizeto20px;colortoblack.
-
Style the list-items to have a
word-spacingof5pxand make the text bolder. -
Write a selector that targets a class
favoriteThings. Style it with the rules:- Set the width to
500px; - Add
10pxof top margin; - Add
30pxof padding from all sides - Add the
solidorangeleft border of the5pxwidth . Note! To add a border only to the left side, use the propertyborder-leftthe same way you would use theborder.
- Set the width to
-
Write a rule to select all paragraphs with the class
descriptionand set the margin top and bottom to 10px using the shorthand. -
Set the position to
absolute, shift it350pxfrom 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.
Grazie per i tuoi commenti!
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Mi faccia domande su questo argomento
Riassuma questo capitolo
Mostri esempi dal mondo reale
Awesome!
Completion rate improved to 5
Challenge
Scorri per mostrare il menu
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.cssfile 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-sizeto16px, line-height to1.2and font-family tosans-serifusing 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
styleMeas:text-indentto10px;font-sizeto20px;colortoblack.
-
Style the list-items to have a
word-spacingof5pxand make the text bolder. -
Write a selector that targets a class
favoriteThings. Style it with the rules:- Set the width to
500px; - Add
10pxof top margin; - Add
30pxof padding from all sides - Add the
solidorangeleft border of the5pxwidth . Note! To add a border only to the left side, use the propertyborder-leftthe same way you would use theborder.
- Set the width to
-
Write a rule to select all paragraphs with the class
descriptionand set the margin top and bottom to 10px using the shorthand. -
Set the position to
absolute, shift it350pxfrom 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.
Grazie per i tuoi commenti!