Example code for implementing a QR code scanning box with CSS

Example code for implementing a QR code scanning box with CSS

We usually have a scanning box when we open the camera, and sometimes a static QR code will also add a frame for focusing and facilitating scanning. Here's how to implement a frame through CSS

Effect:

The code is as follows:

html:

<div class="img-box">
    <img class="code" src="https://image-static.segmentfault.com/149/570/149570997-5b987cc928d69_articlex">
</div>

css:

.img-box {
  background: linear-gradient(#ae0000, #ae0000) left top,
    linear-gradient(#ae0000, #ae0000) left top,
    linear-gradient(#ae0000, #ae0000) right top,
    linear-gradient(#ae0000, #ae0000) right top,
    linear-gradient(#ae0000, #ae0000) right bottom,
    linear-gradient(#ae0000, #ae0000) right bottom,
    linear-gradient(#ae0000, #ae0000) left bottom,
    linear-gradient(#ae0000, #ae0000) left bottom;
  background-repeat: no-repeat;
  background-size: 2px 20px, 20px 2px;
  height: 116px;
  width: 116px;
}        
.code {
    height: 110px;
    width: 110px;
    margin-top: 2px;
    margin-left:2px;
    border: 1px solid #ae0000;
}    

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

<<:  Implementation of tomcat deployment project and integration with IDEA

>>:  mysql implements adding time automatically adding and updating time automatically updating operation

Recommend

The correct way to migrate MySQL data to Oracle

There is a table student in the mysql database, i...

Summary of the unknown usage of "!" in Linux

Preface In fact, the humble "!" has man...

Teach you to quickly build a web cluster project based on nginx

Table of contents 1. Project Environment 2. Proje...

Perfect solution to MySQL common insufficient memory startup failure

1. If MySQL is not started successfully, check th...

The principles and defects of MySQL full-text indexing

MySQL full-text index is a special index that gen...

How InnoDB implements serialization isolation level

Serialization implementation InnoDB implements se...

Access the MySQL database by entering the DOS window through cmd under Windows

1. Press win + R and type cmd to enter the DOS wi...

Detailed explanation of JavaScript clipboard usage

(1) Introduction: clipboard.js is a lightweight J...

The difference between mysql outer join and inner join query

The syntax for an outer join is as follows: SELEC...

css add scroll to div and hide the scroll bar

CSS adds scrolling to div and hides the scroll ba...

Some experience sharing on enabling HTTPS

As the domestic network environment continues to ...

How to use jsonp in vue

Table of contents 1. Introduction 2. Installation...