使用 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>