Challenge
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
This challenge will review the selectors and cascade concepts we learned in the section. The task is to complete the following steps :
- Using a list of selectors, change the text alignment to
centerin both<h1>and<h2>. - In the
<div>withclass"welcome", change the background color to#f6f2f2. - Set the bottom margin of a
"welcome"<div>to50px. - Set the left padding to
30pxfor the paragraphs that are direct children of the"welcome"class. - Change the text color of a heading inside a
"welcome"classto#800000. - For item with
id="important"set the font size to20px. - Using the adjacent sibling selector, set the font style of the paragraph adjacent to the
#importantitem to italic.
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 a 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.26
Challenge
Scorri per mostrare il menu
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
This challenge will review the selectors and cascade concepts we learned in the section. The task is to complete the following steps :
- Using a list of selectors, change the text alignment to
centerin both<h1>and<h2>. - In the
<div>withclass"welcome", change the background color to#f6f2f2. - Set the bottom margin of a
"welcome"<div>to50px. - Set the left padding to
30pxfor the paragraphs that are direct children of the"welcome"class. - Change the text color of a heading inside a
"welcome"classto#800000. - For item with
id="important"set the font size to20px. - Using the adjacent sibling selector, set the font style of the paragraph adjacent to the
#importantitem to italic.
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 a sandbox window
Grazie per i tuoi commenti!