开发中使用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 solid 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设置边框四角样式的更多相关文章

  1. 使用CSS设置边框和背景

    一.设置边框 1.边框样式 属性 说明 border-width 设置边框的宽度 boder-style 设置边框的样式 border-color 设置边框的颜色 a.border-width属性 自 ...

  2. CSS设置边框、符号、背景样式、链接属性

    一.CSS边框空白 padding-top:10px; /*上边框留空白*/ padding-right:10px; /*右边框留空白*/ padding-bottom:10px; /*下边框留空白* ...

  3. 详解CSS设置默认字体样式

    浏览器默认的样式往往在不同的浏览器.不同的语言版本甚至不同的系统版本都有不同的设置,这就导致如 果直接利用默认样式的页面在各个浏览器下显示非常不一致,于是就有了类似YUI的reset之类用来尽量重写浏 ...

  4. css设置网页打印样式

    有三种方法 1. 为屏幕显示和打印分别准备一个css文件,如下所示:  用于屏幕显示的css: <link rel="stylesheet" href="css/n ...

  5. css设置边框阴影;box-shadow的使用

    html代码: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <t ...

  6. 使用css设置边框背景图片

    使用css的特有属性,给不同的盒子添加边框图片. 为什么会有这一场景呢.因为,UI给我们前端的边框图片可能未必适合我们当前的内容. 这里我们主要使用到的属性有: border-image-source ...

  7. CSS设置input默认样式

    HTML <ul class="box"> <li> <input type="checkbox" name="vehi ...

  8. CSS——设置边框渐变色

    前言 最近在写一个typecho的主题,刚好遇到这样一个问题就记录下吧 步骤 这是一个CSS的过度效果,效果如下. 代码 .object{ width: 50px; height: 50px; bac ...

  9. CSS设置浏览器滚动条样式

    /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/ ::-webkit-scrollbar { width: 5px; height: 110px; background-color: #F5 ...

  10. css 设置滚动条的样式

    /*移动端显示滚动条*/ .layui-table-body::-webkit-scrollbar { -webkit-appearance: none; } .layui-table-body::- ...

随机推荐

  1. Android笔记--Android studio里面打开数据库详解

    1.下载Database Navigator插件,然后需要重启Android studio 2.然后会总界面这里.出现这样一个图标 然后选中Database Brower: 3.弹出这样一个界面 然后 ...

  2. 一招教你 Notion 文章导出到公众号

    Notion是一个功能强大的笔记应用程序,有许多优点,包括: 用户友好的界面 跨平台支持 可以结构化组织笔记 多人协作 可以添加多种类型的媒体文件 可以添加评论和任务 这些优点使Notion成为一个广 ...

  3. Xenomai 源码分析-Part I

    Xenomai Edition v3.0.5 xenomai_init() static int __init xenomai_init(void) 源码分析 setup_init_state // ...

  4. DOM属性节点加其他节点的操作

     节点属性 nodeType 返回值为数值                 节点类型(nodeType)    节点名字(nodeName)    节点值(nodeValue)        元素节点 ...

  5. react中自定义函数、生命周期钩子函数、修改状态、组件、组件传值

    1.回顾 2.自定义函数 事件的首字母大小 onclick ==> onClick onchange ==> onChange 普通的点击事件 ---- 调用事件不加(),加了立即执行 i ...

  6. NEFU-NSILAB2021选拔赛WriteUp

    Web signin 打开看到源码: <?php highlight_file(__FILE__); $file = $_GET['file']; if ($file) { include $f ...

  7. [Java]【异常处理】在项目开发中的通用规范

    这一问题,已苦恼多日,上述答案系近整整2日广泛阅读书籍.博客.网络问答后,归纳并苦思而成. 本博文仅罗列总的观点,各观点的具体解释,可私信Word笔记. 如需转载or复制时,请注明出处. 本博文同步发 ...

  8. Solon2 之 Groovy 语言开发后端接口项目

    今天再做个新的尝试,用 Solon 框架写个 Groovy 后端项目.借助 "Solon Initializr" 生成个项目模板,会比较方便. 1.生成项目模板 打开"S ...

  9. 【Note】(坑)一些组合恒等式的实际意义理解(和待填坑的组合数学知识)

    目录 排列组合 恒等式 (1) \(C_n^m=C_n^{n-m}\) (2) \(A_n^m+mA_n^{m-1}=A_{n+1}^m\) (3) \(C_n^{m-1}+C_n^{m}=C_{n+ ...

  10. DG:重启之后主备数据重新同步

    问题描述:本来配置好的DG第二天重启之后,发现主备库数据不能同步,在主库上执行日志切换以及创建表操作都传不到备库上,造成这种错误的原因是主库实例断掉后造成备库日志与主库无法实时接收 主库:orcl  ...