完全用css代码实现二维码扫描图标

简介: 完全用css代码实现二维码扫描图标

image.png

二维码扫描的图标我们经常会用到。一般都是用图片的办法,也有用字体图标的方式。下面这个是用存css来对div进行样式控制来实现的。下面的代码主要借鉴了uniaop

<style>
  .content.top-corner[data-v-36e63766]::after {
    position: absolute;
    top: 0;
    right: 0;
    content: "";
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-right: 4px solid #01b1fc;
    border-top: 4px solid #01b1fc;
    border-top-right-radius: .3125rem;
  }
  .content.top-corner[data-v-36e63766]::before {
    content: "";
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-left: 4px solid #01b1fc;
    border-top: 4px solid #01b1fc;
    border-top-left-radius: .3125rem;
  }
  .content[data-v-36e63766] {
    position: relative;
    display: inline-block;
    top: 1.25rem;
    left: calc(50% - 2.1875rem);
    margin: 0 auto;
    height: 4.375rem;
    width: 4.375rem;
  }
  .content .bottom-corner.bottom-corner[data-v-36e63766]::after {
    float: right;
    content: "";
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-right: 4px solid #01b1fc;
    border-bottom: 4px solid #01b1fc;
    border-bottom-right-radius: .3125rem;
  }
  .content .bottom-corner.bottom-corner[data-v-36e63766]::before {
    content: "";
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-left: 4px solid #01b1fc;
    border-bottom: 4px solid #01b1fc;
    border-bottom-left-radius: .3125rem;
  }
  .content .bottom-corner[data-v-36e63766] {
    position: absolute;
    bottom: .25rem;
    left: 0;
    height: 1.25rem;
    width: 100%;
  }
  .content .line[data-v-36e63766] {
    margin-top: .625rem;
    height: .125rem;
    width: 100%;
    background-color: #01b1fc;
    box-shadow: .0625rem 0 .625rem #01b1fc;
  }
  a[data-v-36e63766] {
    text-decoration: none;
  }
</style>
<a href="#" class="content top-corner" data-v-36e63766="">
  <div class="bottom-corner" data-v-36e63766="">
  </div>
  <div class="line" data-v-36e63766=""></div>
</a>

效果演示:

<style>
  .content.top-corner[data-v-36e63766]::after {
    position: absolute;
    top: 0;
    right: 0;
    content: "";
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-right: 4px solid #01b1fc;
    border-top: 4px solid #01b1fc;
    border-top-right-radius: .3125rem;
  }
  .content.top-corner[data-v-36e63766]::before {
    content: "";
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border-left: 4px solid #01b1fc;
    border-top: 4px solid #01b1fc;
    border-top-left-radius: .3125rem;
  }
  .content[data-v-36e63766] {
    position: relative;
    display: inline-block;
    top: 1.25rem;
    left: calc(50% - 2.1875rem);
    margin: 0 auto;
    height: 4.375rem;
    width: 4.375rem;
  }

image.png



目录
相关文章
|
2月前
|
前端开发
简单几行代码CSS实现网页自动打文字效果
简单几行代码CSS实现网页自动打文字效果
40 1
简单几行代码CSS实现网页自动打文字效果
|
5月前
|
编解码 前端开发
编写代码中常见问题汇总(html和css)
编写代码中常见问题汇总(html和css)
49 0
|
2月前
|
前端开发
HTML静态网页设计作业、仿写大学官网 (力争使用最少的Html 、CSS代码实现)
这篇文章展示了一个仿大学官网的HTML静态网页设计作业,重点在于使用最少的HTML和CSS代码实现页面效果,并便于后期维护。
HTML静态网页设计作业、仿写大学官网 (力争使用最少的Html 、CSS代码实现)
|
2月前
|
前端开发
零基础 CSS 入门问题之CSS 代码的一般格式是什么样的
零基础 CSS 入门问题之CSS 代码的一般格式是什么样的
|
2月前
|
前端开发 JavaScript
使用Vue+CSS实现汉堡图标过渡为叉号图标,有点意思
本文分享了如何使用Vue和CSS实现一个汉堡图标在点击时过渡为叉号图标的动画效果,并提供了详细的实现代码和效果演示。
59 0
使用Vue+CSS实现汉堡图标过渡为叉号图标,有点意思
|
3月前
|
前端开发
css特效——纯css绘制图标:带框的加号(添加按钮)、三横(三道杠)、带圈点(双层圆点)
css特效——纯css绘制图标:带框的加号(添加按钮)、三横(三道杠)、带圈点(双层圆点)
66 5
|
3月前
|
前端开发
你不知道的css——4. 基线、中线、x-height、单位ex(含文本与图标对齐技巧)
你不知道的css——4. 基线、中线、x-height、单位ex(含文本与图标对齐技巧)
35 2
|
3月前
|
前端开发
css图标合并——ClipPath Sprites技术
css图标合并——ClipPath Sprites技术
36 1
|
3月前
|
前端开发
css 实用技巧 —— 文字和图标垂直居中对齐(四种方法)
css 实用技巧 —— 文字和图标垂直居中对齐(四种方法)
1301 1
|
3月前
|
前端开发
css 图标和文字对齐 —— 垂直居中对齐,任意位置对齐
css 图标和文字对齐 —— 垂直居中对齐,任意位置对齐
60 2