css圖片邊緣陰影效果


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>

3.代碼效果展示


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM