麻烦老师帮我看看有没有需要改进的?
来源:4-8 自由编程
Livesinkon
2020-11-10 20:39:30
# 具体遇到的问题
# 报错信息的截图
# 相关课程内容截图
# 尝试过的解决思路和结果
# 粘贴全部相关代码,切记添加代码注释(请勿截图)
【以下是HTML部分】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="/css/css/4_8css.css">
</head>
<body>
<div class="box1">
<h1>ABOUT</h1>
<div class="line"></div>
<p class="p1">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
the industry's standard dummy text ever since the 1500s. </p>
</div>
<div class="box2">
<img class="img" src="/images/素材/4_8pic.jpg" alt="">
<div class="box2_1">
<h2>A WORD <span>ABOUT US</span> </h2>
<div class="box2_1_1">
<p class="p2">
Praesent dignissim viverra est, sed bibendum ligula congue non. Sed ac nisl et felis gravida
commodo? Suspendisse eget ullamcorper ipsum.suspendisse diam amet.
</p>
<p class="p3">EXPLORE</p>
</div>
</div>
<div class="box2_2">
<div class="box2_2_1">
<p class="p4">70000</p>
<div class="line"></div>
<p class="p5">Students</p>
</div>
<div class="box2_2_2">
<p class="p6">600</p>
<div class="line"></div>
<p class="p7">Faculty</p>
</div>
</div>
</div>
</body>
</html>
【以下是CSS部分】
*{
padding:0;
margin: 0;
}
.box1{
width: 1201px;
margin: 0 auto;
}
.box1 h1{
font-size: 32px;
text-align: center;
margin-top: 30px;
}
.line{
width: 60px;
height: 3px;
background-color: #07cbc8;
margin:10px auto;
}
.box1 .p1{
width: 450px;
text-align: center;
color: gray;
font-size: 14px;
margin:0 auto;
}
.box2{
position: relative;
width: 1201px;
height:464px;
margin: 0 auto;
}
.box2 .img{
position: absolute;
float:left;
width: 650px;
height: 435px;
display: block;
top: 30px;
left:270px;
}
.box2 .box2_1{
float:left;
margin-top: 30px;
}
.box2 .box2_1 h2{
font-size: 28px;
font-weight: bold;
}
.box2 .box2_1 h2 span{
font-size: 28px;
font-weight: bold;
display:block;
}
.box2 .box2_1 .box2_1_1{
position: absolute;
width: 340px;
margin-top: 30px;
border: 1px solid gray;
background-color: rgba(255,255,255,0.5);
}
.box2 .box2_1 .box2_1_1 .p2{
width: 300px;
font-size: 18px;
padding: 20px;
}
.box2 .box2_1 .box2_1_1 .p3{
width: 140px;
height: 40px;
margin-top: 20px;
margin-left:20px;
margin-bottom:20px;
color:white;
background-color: black;
text-align: center;
line-height: 40px;
}
.box2 .box2_2{
float: right;
margin-top: 30px;
width: 260px;
text-align: center;
}
.box2 .box2_2 .box2_2_1{
padding-top: 40px;
padding-bottom: 40px;
margin-bottom: 30px;
border: 1px solid #07cbc8;
}
.box2 .box2_2 .box2_2_1 .p4{
font-size: 28px;
font-weight: bold;
}
.box2 .box2_2 .box2_2_1 .p5{
font-size: 20px;
}
.box2 .box2_2 .box2_2_2{
padding-top: 40px;
padding-bottom: 40px;
border: 1px solid #07cbc8;
}
.box2 .box2_2 .box2_2_2 .p6{
font-size: 28px;
font-weight: bold;
}
.box2 .box2_2 .box2_2_2 .p7{
font-size: 20px;
}
1回答
同学你好,代码实现的很好。不需要优化了,祝学习愉快~
相似问题
回答 1
回答 1
回答 2
回答 1
回答 1