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.
¡Gracias por tus comentarios!
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Pregunte me preguntas sobre este tema
Resumir este capítulo
Mostrar ejemplos del mundo real
Awesome!
Completion rate improved to 5
Challenge
Desliza para mostrar el menú
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.
¡Gracias por tus comentarios!