Blogger Information
Blog 35
fans 0
comment 0
visits 16761
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
状态伪类选择器与盒模型
手机用户311660634
Original
261 people have browsed it


<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=, initial-scale=1.0">
<title>Document</title>
<style>

/点击输入框,输入框背景变色,延时0.4秒执行/
fieldset :focus {
background-color: lightgreen;
transition: 0.4s;
}
/ 复选框被选中变成红色 /
input[type=’checkbox’]:checked + label {
color: red;
}
/ a连接被点击过的时候呈现绿色 /
a:visited{
color: green;
}
/ 当有鼠标悬停在链接上变紫色 /
a:hover{
color:blueviolet;
}
/当被点击的时候会变蓝色/
a:active{
color:blue;
}

{
padding: 0;
margin: 0;
box-sizing: border-box;
}

.box {
/
盒子宽度 /
width: 100px;
/
盒子高度 /
height: 100px;
/
盒子内边距 /
padding: 20px;
/
盒子外边距 /
margin: 10px auto;
/
盒子背景色 /
background-color: blue;
/
盒子边框 /
border: 10px solid black;

}
/
margin 和 padding的简写规则 按照顺时针顺序 上右下左 /
/
三值二值只要记住第一个元素一定有个上,第二个原色肯定是左右就可以 /

.box1 {
width: 100px;
height: 100px;
/
三值法:上,左右,下 /
padding: 20px 10px 30px;
margin: 10px auto;
background-color: pink;
border: 3px solid black;
background-clip: content-box;

}
.box2 {
width: 100px;
height: 100px;
/
二值法:上下,左右 /
padding: 20px 10px;
margin: 10px auto;
background-color: yellow;
border: 3px solid black;
background-clip: content-box;

}

.box3 {
width: 100px;
height: 100px;
/
四值,上,左,下,右,手表的12点钟,3点钟,6点粥,9点粥 */
padding: 20px 10px 30px 40px;
margin: 10px auto;
background-color: pink;
border: 1px solid black;
background-clip: content-box;

}

</style>
</head>
<body>
<form action="test.php" method="post">
<fieldset>
<legend>用户注册</legend>
<div class="name">
<label for="uname">用户名:</label>
<input type="text" name="username" id="uname" value="" placeholder="用户名只能是英文或数字" required>
</div>
<div class="psaa">
<label for="PWD">密码:</label>
<input type="password" name="password" id="PWD" value="" placeholder="密码最少六位" required>
</div>
<div>
<input type="checkbox" id="rem" name="remember" checked />
<label for="rem">记住我</label></div>
<div><a href="https://www.php.cn/" target="_blank">点击进入php中文网</a></div>
<button>提交</button>
</fieldset>
</form>

<div class="box">
简单的盒子
</div>
<p class="box1">三值</p>
<p class="box2">二值</p>
<p class="box3">四值</p>

</body>
</html>

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:代码内容可以使用代码块包裹,这样会有高亮显示,更加方便阅读
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post