老师对吗?box-shadow属性在在过渡之前需要写不?
来源:2-4 编程练习
我不是胖球球
2021-04-25 17:40:37
相关代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>过渡</title>
<style>
/*补充代码*/
* {
padding: 0;
margin: 0%;
}
div {
width: 200px;
height: 200px;
margin: 20px auto;
background-color: rgba(241, 185, 194, 0.596);
transition: background-color 1dows linear 0s;
transition: box-sha 3s linear 0s;
box-shadow: 0px 0px 0px transparent;
}
div:hover {
background-color: rgb(250, 165, 8);
box-shadow: 20px 20px 30px rgba(51, 48, 48, 0.247);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
1回答
同学你好,代码实现效果很棒!
另外box-shadow属性在移入前写不写都可以,默认是没有阴影的。
祝学习愉快!
相似问题
回答 2
回答 1