我想给一个带有边框半径的按钮添加一个阴影,但是阴影本身应该位于按钮下方并在其宽度范围内。
我能够获得圆角边框阴影,但是当尝试将其定位在元素的宽度范围内时,边框半径效果会丢失,只能得到没有边框半径的阴影。
.but1 {
width: 200px;
height: 100px;
border: none;
background-color: yellow;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: rgba(0, 0, 0, 0.8) 0 25px 0px -10px;
-moz-box-shadow: rgba(0, 0, 0, 0.8) 0 25px 0px -10px;
box-shadow: rgba(0, 0, 0, 0.8) 0 25px 0px -10px;
}
<button class="but1">
Click me!
</button>
.but
样式,但是使用了.but1
。 - Alexander