当前位置:网站首页>outline和box-shadow实现外轮廓圆角高光效果
outline和box-shadow实现外轮廓圆角高光效果
2022-07-25 15:06:00 【深海蓝山】
outline的属性和border很相似,可以实现元素高光或外轮廓透亮效果,但是没有圆角效果,可以使用box-shadow模拟outline的圆角效果
outline定义和用法
outline (轮廓)是绘制于元素周围的一条线,位于边框边缘的外围,可起到突出元素的作用。
注释:轮廓线不会占据空间,也不一定是矩形。
outline 简写属性在一个声明中设置所有的轮廓属性。
可以按顺序设置如下属性:
- outline-color
- outline-style
- outline-width
box-shadow定义和用法
box-shadow 属性向框添加一个或多个阴影
语法
box-shadow: h-shadow v-shadow blur spread color inset;
注释:box-shadow 向框添加一个或多个阴影。该属性是由逗号分隔的阴影列表,每个阴影由 2-4 个长度值、可选的颜色值以及可选的 inset 关键词来规定。省略长度的值是 0
| 值 | 描述 |
|---|---|
| h-shadow | 必需。水平阴影的位置。允许负值。 |
| v-shadow | 必需。垂直阴影的位置。允许负值。 |
| blur | 可选。模糊距离。 |
| spread | 可选。阴影的尺寸。 |
| color | 可选。阴影的颜色。请参阅 CSS 颜色值。 |
| inset | 可选。将外部阴影 (outset) 改为内部阴影。 |
box-shadow模拟outline的圆角效果
实现外轮廓透明效果或高光效果还是不错的
outline效果
.outline {
outline: solid 10px rgba(34, 139, 34, 0.5);
}box-shadow效果
.box-shadow {
box-shadow: 0 0 0 10px rgba(245, 0, 0, 0.5);
}
边栏推荐
- String type time comparison method with error string.compareto
- Content type corresponding to office file
- How many ways can you assign initial values to a two-dimensional array?
- PHP 通过原生CURL实现非阻塞(并发)请求模式
- [C题目]力扣876. 链表的中间结点
- [MySQL series] - how much do you know about the index
- API health status self inspection
- QT connect, signal, slot and lambda comparison
- node学习
- 图片的懒加载
猜你喜欢

39 简洁版小米侧边栏练习

冈萨雷斯 数字图像处理 第一章绪论

6月产品升级观察站

Pl/sql creates and executes ORALCE stored procedures and returns the result set

6线SPI传输模式探索

"How to use" agent mode

Add the jar package under lib directory to the project in idea

阿里云技术专家邓青琳:云上跨可用区容灾和异地多活最佳实践

Leo-sam: tightly coupled laser inertial odometer with smoothing and mapping

Nacos2.1.0 cluster construction
随机推荐
[C topic] Li Kou 206. reverse the linked list
pl/sql 创建并执行oralce存储过程,并返回结果集
MySQL的登陆【数据库系统】
了解一下new的过程发生了什么
sql server强行断开连接
Several methods of spark parameter configuration
"How to use" decorator mode
35 快速格式化代码
LeetCode-198-打家劫舍
浏览器工作流程(简化)
解决asp.net上传文件时文件太大导致的错误
js URLEncode函数
瀑布流布局
006 operator introduction
Content type corresponding to office file
Cmake specify opencv version
Reprint ---- how to read the code?
When using jetty to run items, an error is reported: form too large or form too many keys
Scala110-combineByKey
@Scheduled source code analysis