7.2-1背景颜色基础知识
background-color属性
-
background-color属性表示背景颜色;
-
背景颜色可以用十六进制、rgb()、rgba()表示法表示;
-
padding区域是有背景颜色的;
实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> body{ background-color: aqua; } .box{ padding: 100px; width: 200px; height: 200px; background-color: orange; border: 1px solid #000; } </style> </head> <body> <div class="box"></div> </body> </html>