使用 CSS 設定背景色
要使用 CSS 設定背景色,請使用 background-color 屬性。
示例
我們現在來看一個示例 -
<!DOCTYPE html> <html> <head> <style> .demo { text-decoration: overline underline; background-color: red; } </style> </head> <body> <h1>Details</h1> <p class="demo">Examination Center near ABC College.</p> <p class="demo2">Exam begins at 9AM.</p> </body> </html>
輸出
示例
我們現在來看另一個示例 -
<!DOCTYPE html> <html> <head> <style> .demo { text-decoration: overline underline; } </style> </head> <body style="background-color: orange;color: white;"> <h1>Details</h1> <p class="demo">Examination Center near ABC College.</p> <p class="demo2">Exam begins at 9AM.</p> </body> </html>
輸出
廣告