使用 CSS 設定元素的背景色


若要設定元素的背景色,請使用 background-color 屬性。

示例

您可以嘗試執行以下程式碼,瞭解如何使用 background-color 屬性

<html>
   <head>
      <body>
         <p style = "background-color:blue;">
         This text has a blue background color.</p>
      </body>
   </head>
<html>

更新於:2020-01-30

309 次瀏覽

啟動 事業

完成課程,獲得認證

開始
廣告