1.為什么添加陰影:
我們顯示圖片的時候為了單調通常都會添加一個陰影效果為了顯示美觀
主要實用了box-shadow:屬性 屬性介紹
2.代碼示例:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>圖片按鈕實驗</title>
<style type="text/css">
img{
border-radius: 5px;
margin-top: 40px;
margin-left: 300px;
width: 700px;
height: 400px;
box-shadow:0 5px 20px rgba(0,0,0,0.5)
}
</style>
</head>
<body>
<img src="https://i.loli.net/2020/04/11/6ZfB4y5oVpWHC9N.png">
</body>
</html>