网站首页 > 知识剖析 正文
切图网专注于html5前端切图开发,下面给大家介绍一下前端切图css高级阴影用法drop-shadow,主要是在最近项目切图中遇到的,通常我们了解的css的阴影写法就是shadow,但是它不能解决非规则图形的阴影效果,而drop-shadow可以做到。
给图像设置一个阴影效果。阴影是合成在图像下面,可以有模糊度的,可以以特定颜色画出的遮罩图的偏移版本。参数与box-shadow类似。但inset关键字不允许。
<div class="shadow">不规则边框</div>
.shadow{
color: #fff;
font-size: 24px;
text-align: center;
width: 200px;
height: 200px;
line-height: 200px;
/*渐变背景制作圆缺角*/
background:
radial-gradient(circle at top left, transparent 25px, red 0) top left,
radial-gradient(circle at top right, transparent 25px, red 0) top right,
radial-gradient(circle at bottom right, transparent 25px, red 0) bottom right,
radial-gradient(circle at bottom left, transparent 25px, red 0) bottom left;
background-size: 50% 50%;
background-repeat: no-repeat;
/*不规则阴影*/
filter:drop-shadow(0 0 12px rgba(0,0,0,0.5));
}
- 上一篇: CSS3新增(1)_css3新增属性
- 下一篇: Wordpress建站教程:给图片添加CSS样式
猜你喜欢
- 2025-08-31 Wordpress建站教程:给图片添加CSS样式
- 2025-08-31 CSS3新增(1)_css3新增属性
- 最近发表
- 标签列表
-
- xml (46)
- css animation (57)
- array_slice (60)
- htmlspecialchars (54)
- position: absolute (54)
- datediff函数 (47)
- array_pop (49)
- jsmap (52)
- toggleclass (43)
- console.time (63)
- .sql (41)
- ahref (40)
- js json.parse (59)
- html复选框 (60)
- css 透明 (44)
- css 颜色 (47)
- php replace (41)
- css nth-child (48)
- min-height (40)
- xml schema (44)
- css 最后一个元素 (46)
- location.origin (44)
- table border (49)
- html tr (40)
- video controls (49)