⊗mkPmDcBF 93 of 250 menu

Setting background color in CSS

You already know how to change the text color. Now let's learn how to change the background color. This is done using the background-color property, which takes the same values ​​as the well-known color.

Let's fill the block with an orange background (and make the text color white):

<div id="elem"> Lorem ipsum dolor sit amet. </div> #elem { width: 300px; height: 100px; color: white; background-color: orange; /* set the background color to orange */ }

:

Repeat the page according to this example:

Repeat the page according to this example:

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline