Correcting teacher:天蓬老师
Correction status:qualified
Teacher's comments:对em是不是有感觉了?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>盒模型</title>
<style>
.box {
width: 300px;
height: 300px;
background-color: coral;
border: dashed 10px black;
border-top: solid 30px cyan;
border-radius: 20px;
border-right: solid 40px magenta;
border-bottom: solid 30px yellow;
border-left: solid 40px black;
text-align: center;
font-size: 80px;
padding: 30px;
margin: 10px 20px 30px;
}
.t1 {
color: red;
}
.t2 {
color: green;
}
.t3 {
color: blue;
}
.t4 {
color: purple;
}
.box p {
font-size: 30px;
color: black;
text-align: right;
padding: 50px 0px;
}
</style>
</head>
<body>
<div class="box">
<span class="t1">开</span>
<span class="t2">吉</span>
<span class="t3">尔</span>
<span class="t4">软件</span>
<p>PHP中文网</p>
</div>
</body>
</html>
效果图:
如下图
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>box-sizing</title>
<style>
.box1 {
/* 默认的盒子模型 尺寸没有包括padding 和border
*/
box-sizing: content-box;
width: 10em;
height: 10em;
border: solid 0.625em red;
}
.box2 {
box-sizing: border-box;
width: 10em;
height: 10em;
border: solid 10px green;
}
</style>
</head>
<body>
<div class="box1">开吉尔</div>
<br />
<div class="box2">开吉尔软件</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>em</title>
<style>
.box1 {
font-size: 1em;
}
.box2 {
font-size: 2em;
}
.box3 {
font-size: 3em;
}
</style>
</head>
<body>
<div class="box1">开吉尔</div>
<div class="box2">软件</div>
<div class="box3">开吉尔软件</div>
</body>
</html>