<!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 { padding: 100px; } div { width: 300px; height: 300px; border: 2px solid #ddd; box-shadow: 10px 10px rgba(100, 100, 100, .2); /*前两个参数 :偏移量 rgba表示颜色带透明度*/ } </style> </head> <body> <article> <div>helloworld</div> </article> </body> </html>