css设置边框四角样式
2019-08-06 16:46
1761 查看
版权声明:署名,允许他人基于本文进行创作,且必须基于与原先许可协议相同的许可协议分发本文 (Creative Commons)
开发中使用css 伪类 是再常见不过的事情了,运用好了能轻松实现许多复杂的样式,大大减少使用图片消耗带宽的问题,今天我们就使用伪类来实现登录框的四角样式
html代码如下
<div class="form backLoginForm"> <el-form :model="formData" ref="form"> <!-- 添加自己的form 内容 --> </el-form> <div class="angle angle-left-top"></div> <div class="angle angle-left-bottom"></div> <div class="angle angle-right-top"></div> <div class="angle angle-right-bottom"></div> </div>
css 样式
.angle { position: absolute; width: 20px; height: 20px; } .angle-left-top { top: 0; left: 0; border-left: 4px solid rgba(7,185,255,0.5); border-top: 4px solid rgba(7,185,255,0.5); } .angle-left-top:after{ content: ""; border-radius: 0; font-size: 0; width: 0; height: 0; position: absolute; padding: 0; top:-4px; right:0; border-left: 4px solid transparent; border-right: 4px solid rgb(28,32,122); border-bottom: 4px solid rgb(28,32,122);; } .angle-left-top:before{ content: ""; border-radius: 0; font-size: 0; width: 0; height: 0; position: absolute; padding: 0; bottom:0; left:-4px; border-top: 4px solid transparent; border-right: 4px solid rgb(28,32,122); border-bottom: 4px solid rgb(28,32,122);; } .angle-right-top { top: 0; right: -2px; border-right: 4px solid rgba(7,185,255,0.5); border-top: 4px solid rgba(7,185,255,0.5); } .angle-right-top:after{ content: ""; border-radius: 0; font-size: 0; width: 0; height: 0; position: absolute; padding: 0; bottom:0; right:-4px; border-right: 4px solid transparent; border-left: 4px solid rgb(28,32,122); border-bottom: 4px solid rgb(28,32,122);; } .angle-right-top:before{ content: ""; border-radius: 0; font-size: 0; width: 0; height: 0; position: absolute; padding: 0; top:-4px; left:0; border-top: 4px solid transparent; border-left: 4px solid rgb(28,32,122); border-bottom: 4px solid rgb(28,32,122);; } .angle-left-bottom { bottom: 0; left: 0; border-bottom: 4px solid rgba(7,185,255,0.5); border-left: 4px solid rgba(7,185,255,0.5); } .angle-left-bottom:after{ content: ""; border-radius: 0; font-size: 0; width: 0; height: 0; position: absolute; padding: 0; bottom:-4px; right:0; border-left: 4px solid transparent; border-top: 4px solid rgb(28,32,122); border-right: 4px solid rgb(28,32,122);; } .angle-left-bottom:before{ content: ""; border-radius: 0; font-size: 0; width: 0; height: 0; position: absolute; padding: 0; top:0; left:-4px; border-left: 4px solid transparent; border-top: 4px solid rgb(28,32,122); border-right: 4px solid rgb(28,32,122);; } .angle-right-bottom { bottom: 0; right: -2px; border-right: 4px solid rgba(7,185,255,0.5); border-bottom: 4px solid rgba(7,185,255,0.5); } .angle-right-bottom:after{ content: ""; border-radius: 0; font-size: 0; width: 0; height: 0; position: absolute; padding: 0; bottom:-4px; left:0; border-right: 4px so 4000 lid transparent; border-top: 4px solid rgb(28,32,122); border-left: 4px solid rgb(28,32,122);; } .angle-right-bottom:before{ content: ""; border-radius: 0; font-size: 0; width: 0; height: 0; position: absolute; padding: 0; top:0; right:-4px; border-right: 4px solid transparent; border-top: 4px solid rgb(28,32,122); border-left: 4px solid rgb(28,32,122);; }
- 最终实现
相关文章推荐
- CSS:表格样式(设置表格边框/文字/背景的样式)
- CSS如何设置html table表格边框样式
- CSS如何设置html table表格边框样式
- css 链接变颜色 (加边框设置样式)
- CSS盒模型--边框设置:border: 1px solid red(像素 样式 颜色 ),border-bottom:1px dotted #ccc
- css 链接变颜色 (加边框设置样式)
- CSS样式设置语法全解,样式优先级、值和单位、字体、文本、块级元素,行内元素,替换元素、非替换元素、display、float、position、table、li、光标、边距边框、轮廓、颜色背景
- CSS如何设置html table表格边框样式
- css 设置网页边框滚动条样式
- W3C笔记-CSS巧妙设置table边框border的样式
- css 链接变颜色 (加边框设置样式)
- CSS:表格样式(设置表格边框/文字/背景的样式)
- css 链接变颜色 (加边框设置样式)
- CSS如何设置html table表格边框样式
- CSS如何设置html table表格边框样式
- css 链接变颜色 (加边框设置样式)
- css 链接变颜色 (加边框设置样式)
- css基础 设置div标签 宽度 边框线颜色样式 div中文本居中 div块在网页中居中 div中内容距边框线的距离
- css解决select不能被遮盖和不能设置边框背景补白等样式的问题
- CSS border-right-style属性设置元素的右边框样式