demo代码如下: 注意:是通过判断是否存在某种ID值,然后添加id实现的。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<scrip class="sr"></scrip>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<style type="text/css">
.box {
width: 200px;
height: 200px;
position: relative;
}
.box1,.box2 {
width: 200px;
height: 200px;
position: absolute;
top: 0;
left: 0;
text-align: center;
line-height: 200px;
font-size: 50px;
backface-visibility: hidden;
b