实例
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>背景颜色的设置</title> <style> div{ width:200px; height:100px; } .item-1{ background-color: red; } .item-2{ background-color:rgb(0,0,0); } .item-3{ background-color:rgba(0,0,0,0.5); } .item-4{ background-color:#452215 } </style> </head> <body> <!--background-color设置颜色的四个值 1.具体单词 2.rgb 3.rgba 4.十六进制--> <div class="item-1"></div> <div class="item-2"></div> <div class="item-3"></div> <div class="item-4"></div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例