发表于: 2022-08-27 21:43:34
0 740
今天将昨天的问题解决了。
原因是没分配好几个盒子。将顶部一分为二,设置两个盒子之后,在设置好各自一半的宽度将顶部完成设置。
css代码:
* {
margin: 0;
padding: 0;
}
.box {
height: 100vh;
background-color: #ffffff;
margin: 0 auto;
}
p {
color: #999999;
display: inline-block;
font-size: 25px;
}
.head {
height: 126px;
background-color: #5fc0cd;
}
.paging {
width: 50%;
float: left;
position: absolute;
margin: auto;
}
.location {
width: 50%;
float: right;
}
.location1 {
float: right;
margin-top: 57px;
margin-right: 30px;
}
.employer {
background-color: #55a8b3;
border-radius: 10px;
float: right;
position: relative;
margin-top: 80px;
}
.employer p {
font-size: 34px;
text-align: center;
color: #ffffff;
margin: auto;
}
.nursing-workers {
background-color: #ffffff;
border-radius: 10px;
float: left;
position: relative;
margin-top: 80px;
}
.nursing-workers p {
font-size: 34px;
text-align: center;
color: #87d0da;
margin: auto;
}
.navigation {
height: auto;
}
.rectangle1 {
display: inline-block;
width: 32%;
border-right-style: solid;
color: #e2e6e8;
text-align: center;
}
.rectangle2 {
display: inline-block;
width: 32%;
border-right-style: solid;
color: #e2e6e8;
text-align: center;
}
.rectangle3 {
display: inline-block;
width: 33%;
text-align: center;
}
.icon1 {
display: inline-block;
float: right;
margin: auto;
}
.details {
display: inline-block;
font-size: 28px;
color: #b4b4b4;
margin: auto;
}
.black {
font-size: 25px;
color: #333333;
font-weight:bolder;
padding: 2% 10%;
}
.red {
font-size: 30px;
color: red;
float: right;
margin: auto;
}
.date {
display: inline-block;
margin: auto 3%;
}
.address {
display: inline-block;
margin: auto 3%;
}
.return {
float: right;
margin: 1% 3%;
}
.content {
height: auto;
border-top-style: solid;
color: #e1e5e7;
}
.service-date {
height: 70px;
border-top-style: solid;
color: #e1e5e7;
}
.bottom {
width: 100%;
height: auto;
background-color: #f8fafb;
}
.home-page {
display: inline-block;
width: 25%;
float: left;
text-align: right;
margin: auto;
}
.write {
width: 40%;
height: auto;
display: inline-block;
}
.garden {
display: inline-block;
background-color: #5fc0cd;
width: 99px;
height: 99px;
border-radius: 60px;
text-align: center;
margin-left: 40%;
float: left;
}
.my {
display: inline-block;
width: 25%;
float: right;
margin: auto;
}
.typeface1 {
color: #999999;
font-size: 28px;
text-align: right;
}
.typeface2 {
color: #999999;
font-size: 28px;
}
.icon {
padding: 25%;
}
html代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,height=100%, initial-scale=1.0 ">
<link rel="stylesheet" href="pecruitment-page.css">
<title>Title</title>
</head>
<body>
<div class="box">
<div class="head">
<div class="paging">
<div class="employer">
<p>找雇主</p>
</div>
</div>
<div class="location">
<div class="nursing-workers">
<p>找护工</p>
</div>
<img class="location1" src="tupian/形状%202.png" alt="定位">
</div>
</div>
<div class="navigation">
<div class="rectangle1">
<p class="details">所在地</p>
<img class="icon1" src="tupian/形状%201.png" alt="小图标">
</div><div class="rectangle2">
<p class="details">食宿</p>
<img class="icon1" src="tupian/形状%201.png" alt="小图标">
</div><div class="rectangle3">
<p class="details">病人情况</p>
<img class="icon1" src="tupian/形状%201.png" alt="小图标">
</div>
</div>
<div class="content">
<div>
<img class="date" src="tupian/calendar2%20拷贝%204.png" alt="日期">
<p>服务日期</p>
</div>
<div>
<p class="black">2015-7-5 至 2015-7-12</p>
<img class="return" src="tupian/矢量智能对象%20拷贝.png" alt="返回">
<p class="red">25元/小时</p>
</div>
<div>
<img class="address" src="tupian/Shape%204%20拷贝%205.png" alt="地址">
<p>北京.通州.果园</p>
</div>
</div>
<div class="content">
<div>
<img class="date" src="tupian/calendar2%20拷贝%204.png" alt="日期">
<p>服务日期</p>
</div>
<div>
<p class="black">2015-7-5 至 2015-7-12</p>
<img class="return" src="tupian/矢量智能对象%20拷贝.png" alt="返回">
<p class="red">35元/小时</p>
</div>
<div>
<img class="address" src="tupian/Shape%204%20拷贝%205.png" alt="地址">
<p>北京.通州.果园</p>
</div>
</div>
<div class="content">
<div>
<img class="date" src="tupian/calendar2%20拷贝%204.png" alt="日期">
<p>服务日期</p>
</div>
<div>
<p class="black">2015-7-5 至 2015-7-12</p>
<img class="return" src="tupian/矢量智能对象%20拷贝.png" alt="返回">
<p class="red">45元/小时</p>
</div>
<div>
<img class="address" src="tupian/Shape%204%20拷贝%205.png" alt="地址">
<p>北京.通州.果园</p>
</div>
</div>
<div class="content">
<div>
<img class="date" src="tupian/calendar2%20拷贝%204.png" alt="日期">
<p>服务日期</p>
</div>
<div>
<p class="black">2015-7-5 至 2015-7-12</p>
<img class="return" src="tupian/矢量智能对象%20拷贝.png" alt="返回">
<p class="red">45元/小时</p>
</div>
<div>
<img class="address" src="tupian/Shape%204%20拷贝%205.png" alt="地址">
<p>北京.通州.果园</p>
</div>
</div>
<div class="content">
<div>
<img class="date" src="tupian/calendar2%20拷贝%204.png" alt="日期">
<p>服务日期</p>
</div>
<div>
<p class="black">2015-7-5 至 2015-7-12</p>
<img class="return" src="tupian/矢量智能对象%20拷贝.png" alt="返回">
<p class="red">45元/小时</p>
</div>
<div>
<img class="address" src="tupian/Shape%204%20拷贝%205.png" alt="地址">
<p>北京.通州.果园</p>
</div>
</div>
<div class="service-date">
<img class="date" src="tupian/calendar2%20拷贝%204.png" alt="日期">
<p>服务日期</p>
</div>
<div class="bottom">
<div class="home-page">
<img src="tupian/形状%204.png" alt="首页">
<h4 class="typeface1">首页</h4>
</div>
<div class="write">
<div class="garden">
<img class="icon" src="tupian/Write.png" alt="写" >
</div>
</div>
<div class="my">
<img src="tupian/买卖牛人.png" alt="买卖牛人">
<h4 class="typeface2">我的</h4>
</div>
</div>
</div>
</body>
</html>
页面效果:
明天计划将示图细节补充完整之后完成深度思考。
评论