0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>Everything is ready to style the remaining service packages. Recall the example involving the products:</p>
1
<p>Everything is ready to style the remaining service packages. Recall the example involving the products:</p>
2
<li class="product">Product</li> <li class="product hit">Product, which is also a bestseller</li><p>In order to assign all regular products one background color, but bestsellers a different background, you can use the following code:</p>
2
<li class="product">Product</li> <li class="product hit">Product, which is also a bestseller</li><p>In order to assign all regular products one background color, but bestsellers a different background, you can use the following code:</p>
3
.product { … /* general sizes and margins */ background-color: gray; /* gray default background */ } .hit { background-color: yellow; /* yellow background for bestsellers */ }<p>Both CSS rules will be applied to the second product. After all, it has two matching classes. But in order for the background color to be yellow, the .hit rule must be written in the code after the .product rule. In this case, the property background-color from the second rule<i>will override</i>the property value background-color from the first rule.</p>
3
.product { … /* general sizes and margins */ background-color: gray; /* gray default background */ } .hit { background-color: yellow; /* yellow background for bestsellers */ }<p>Both CSS rules will be applied to the second product. After all, it has two matching classes. But in order for the background color to be yellow, the .hit rule must be written in the code after the .product rule. In this case, the property background-color from the second rule<i>will override</i>the property value background-color from the first rule.</p>
4
<p>All this works thanks to the<b>cascade</b>(CSS stands for<i>Cascading</i>Style Sheets, remember). We will examine the cascade in more detail in the fifth chapter of the course. But for now, let’s add a rule for the standard class after the rule for the class skills-item and override the color of the frame and text in it. And don’t forget to add the period to the class selector.</p>
4
<p>All this works thanks to the<b>cascade</b>(CSS stands for<i>Cascading</i>Style Sheets, remember). We will examine the cascade in more detail in the fifth chapter of the course. But for now, let’s add a rule for the standard class after the rule for the class skills-item and override the color of the frame and text in it. And don’t forget to add the period to the class selector.</p>