Z - index
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
div {
width: 200px;
height: 200px;
position: absolute;
top: 0;
left: 0;
}
div:first-child {
background-color: red;
}
div:nth-child(2) {
width: 300px;
top: 60px;
left: 20px;
background-color: purple;
}
div:last-child {
width: 400px;
left: 30px;
top: 40px;
background-color: orange;
}
</style>
</head>
<body>
<div></div>
<div></div>
<div></div>
</body>
</html>
表单轮廓线
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
input {
outline: 0;
}
textarea {
outline: 0;
resize: none;
}
</style>
</head>
<body>
<input type="text /">
<textarea name="" id="" cols="30" rows="10"></textarea>
<p>段落</p>
</body>
</html>
元素的显示与隐藏
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
div {
width: 120px;
height: 120px;
background-color: red;
margin-bottom: 10px;
}
div:nth-child(2) {
visibility: hidden;
}
div:last-child {
background-color: blue;
}
</style>
</head>
<body>
<div></div>
<div></div>
<div></div>
</body>
</html>
显示和隐藏二维码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
div.content {
width: 100px;
height: 100px;
text-align: center;
line-height: 100px;
background-color: rgba(0,0,0,0.4);
}
.wrap {
position: relative;
}
.wrap .erweima {
position: absolute;
left: 100px;
top: 0;
display: none;
}
.wrap:hover .erweima {
display: block;
}
</style>
</head>
<body>
<div class="wrap">
<div class="content">扫二维码</div>
<div class="erweima">
<img src="img/jd.png" alt="">
</div>
</div>
</body>
</html>
overflow属性的使用
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
div {
width: 120px;
height: 500px;
border: 1px solid #ccc;
overflow: visible;
overflow: hidden;
overflow: auto;
overflow: scroll;
}
</style>
</head>
<body>
<div>
窗前明月光疑是地上霜窗前明月光疑是地上霜窗前明月光疑是地上霜窗前明月光疑是地上霜窗前明月光疑是地上霜窗前明月光疑是地上霜窗前明月光疑是地上霜窗前明月光疑是地上霜
</div>
</body>
</html>
鼠标相关样式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
p:nth-child(1) {
cursor: default;
}
p:nth-child(2) {
cursor: pointer;
}
p:nth-child(3) {
cursor: text;
}
p:nth-child(4) {
cursor: move;
}
p:nth-child(5) {
cursor: help;
}
p:nth-child(6) {
cursor: wait;
}
</style>
</head>
<body>
<div>
<p>aaaa</p>
<p>bbbb</p>
<p>ccccc</p>
<p>ddddd</p>
<p>eeeee</p>
<p>fffff</p>
</div>
</body>
</html>