使用 CSS 設定元素的背景色
要設定元素的背景顏色,請使用 background-color 屬性。
示例
你可以嘗試執行以下程式碼,瞭解如何使用 background-color 屬性。
<html> <head> <body> <p style = "background-color:blue;"> This text has a blue background color.</p> </body> </head> <html>
廣告
要設定元素的背景顏色,請使用 background-color 屬性。
你可以嘗試執行以下程式碼,瞭解如何使用 background-color 屬性。
<html> <head> <body> <p style = "background-color:blue;"> This text has a blue background color.</p> </body> </head> <html>