批改状态:合格
老师批语:相信自己, 努力不一定有回报 ,但不努力肯定没有... 学习也要讲方法, 要不断的总结, 做笔记 , 不要总是写代码, 要有思考的时间
仿php中文网移动端首页
仿制别的首页,暂时搞不定。不知道咋回事。这两天一直回顾视频。自己写起来好费劲。已经很努力,很认真了


.top {
position: fixed;
top: 0;
width: 100%;
height: 42px;
background-color: #444444;
min-width: 320px;
max-width: 768px;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
.top {
display: flex;
}
.top img:first-of-type,
.top img:last-of-type {
width: 25px;
height: 25px;
margin-top: 8px;
}
.top img:first-of-type {
border-radius: 50%;
margin-left: 5px;
}
.top .logo {
text-align: center;
flex: 1;
}
.top .logo img {
width: 94px;
height: 45px;
}
/*轮播图*/
.banner {
display: flex;
}
.banner img {
width: 100%;
height: 160px;
}
/*导航区*/
.nav {
height: 170px;
background-color: white;
box-sizing: border-box;
}
.nav ul {
margin: 0;
padding: 6px;
}
.nav ul li {
list-style-type: none;
text-align: center;
height: 75px;
}
.nav ul li img {
width: 45px;
height: 45px;
}
.nav ul li a {
text-align: center;
color: gray;
text-decoration: none;
}
.nav ul {
display: flex;
}
.nav ul li {
flex: 1;
}
/*推荐课程区*/
h3 {
color:gray;
}
.courses {
height: 326px;
color: gray;
padding: 10px 10px 10px;
}
.courses ul {
margin: 0;
padding: 0;
list-style: none;
/*flex布局*/
display: flex;
justify-content: center;
}
.courses ul li {
padding: 5px;
}
.courses ul img {
width: 100%;
height: 100px;
}
.courses div {
background-color: white;
padding: 10px;
margin-top: 10px;
height: 90px;
/*flex布局*/
display: flex;
justify-content: flex-start;
}
.courses div img {
width: 100%;
height: 90px;
}
.courses div a {
text-decoration: none;
color: gray;
flex: 0.45;
}
.courses div p {
flex: .55;
margin-left: 15px;
}
.courses div p span:first-of-type {
font-size: 0.8rem;
background-color: black;
color: white;
border-radius: 30%;
padding: 0 2px;
}
.courses div p span:last-of-type {
font-size: 0.7rem;
}
/*最近更新*/
body h3:nth-of-type(2) {
margin-top: 50px;
}
.courses-list {
height: 225px;
padding: 10px 10px 10px;
}
.courses-list div {
height: 90px;
background-color: #fff;
padding: 10px;
margin-top: 10px;
display: flex;
justify-content: flex-start;
}
.courses-list div img {
width: 100%;
height: 90px;
}
.courses-list div a {
text-decoration: none;
color: #888;
flex: 0.45;
}
.courses-list div p {
font-size: 0.8rem;
color: #c2c2c2;
margin-left: 15px;
flex: .55;
}
.courses-list div p a {
font-size: 1rem;
}
.courses-list div p span:first-of-type {
margin-top: 10px;
padding: 0 2px;
display: flex;
}
.courses-list div p span:last-of-type {
margin-top: 10px;
padding: 0 2px;
margin-left: 60px;
color: #c2c2c2;
}
.courses-list div p span:nth-last-of-type(2){
margin-top: 10px;
margin-bottom: 10px;
padding: 0 2px;
background-color: #595757;
border-radius: 8px;
color: #fff;
font-size: 0.8rem;
}
/*最新文章*/
.courses-list1 {
height: 215px;
padding: 10px 10px 10px;
}
.courses-list1 div {
display: flex;
justify-content: flex-start;
background-color: #fff;
padding: 5px;
height: 84px;
margin-top: 10px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1);
border-bottom: 1px solid #eee;
}
.courses-list1 div p {
flex: .58;
padding: 0 2px;
margin-top: 5px;
}
.courses-list1 div span {
margin-left: 2px;
padding: 0 2px;
display: flex;
}
.courses-list1 div p a {
text-decoration: none;
color: #777;
font-size: 0.9rem;
font-weight: bold;
}
.courses-list1 div img {
width: 100%;
height: 84px;
}
.courses-list1 div a {
flex: 0.42;
}
.courses-list1 div a:last-of-type {
margin: 5px 15px;
overflow: hidden;
}
.courses-list1 div p a:first-of-type {
margin: 0;
padding: 0;
}
.courses-list1 div p span:first-of-type {
font-size: 0.8rem;
color: #777;
}
/*最新博文*/
.courses-list2 {
height: 180px;
padding: 10px 10px 10px;
}
.courses-list2 div {
background-color: #fff;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1);
border-bottom: 1px solid #eee;
margin-bottom: 8px;
display: flex;
justify-content: flex-start;
height: 60px;
}
.courses-list2 div a {
text-decoration: none;
color: #777;
margin-left: 5px;
font-weight: bold;
font-size: 0.9rem;
}
.courses-list2 div a{
flex: .97;
}
.courses-list2 div a span {
margin-top: 13px;
display: flex;
flex: 0.03;
}
.courses-list2 div p span {
display: flex;
margin-left: 15px;
color: #777;
font-size: 0.8rem;
}
/*底部样式*/
body {
height: 2000px;
}
.footer {
position: fixed;
bottom: 0;
width: 100%;
height: 53px;
min-width: 320px;
max-width: 768px;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}
.footer ul {
display: flex;
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
}
.footer ul li img {
width:20px;
height: 20px;
}
.footer ul li a {
color: gray;
text-decoration: none;
}
.footer ul li {
flex: 1;
}点击 "运行实例" 按钮查看在线实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="static/css/init.css"> <link rel="stylesheet" href="static/css/style.css"> <title>php中文网手机端-首页</title> </head> <body> <!--布局原则: 宽宽自适应, 高度是固定--> <!--固定定位: 顶部--> <div class="top"> <img src="static/images/user-pic.jpeg" alt=""> <div class="logo"> <img src="static/images/logo.png" alt=""> </div> <img src="static/images/user-nav.jpg" alt=""> </div> <!--banner轮播图,这里用图片暂时代替--> <div class="banner"> <img src="static/images/banner.jpg" alt=""> </div> <!--导航区--> <div class="nav"> <ul> <li><a href=""><img src="static/images/html.png" alt=""><br>HTML/CSS</a></li> <li><a href=""><img src="static/images/JavaScript.png" alt=""><br>JavaScript</a></li> <li><a href=""><img src="static/images/code.png" alt=""><br>服务端</a></li> <li><a href=""><img src="static/images/sql.png" alt=""><br>数据库</a></li> </ul> <ul> <li><a href=""><img src="static/images/app.png" alt=""><br>移动端</a></li> <li><a href=""><img src="static/images/manual.png" alt=""><br>手册</a></li> <li><a href=""><img src="static/images/tool2.png" alt=""><br>工具</a></li> <li><a href=""><img src="static/images/live.png" alt=""><br>直播</a></li> </ul> </div> <!--课程区--> <h3>推荐课程</h3> <div class="courses"> <ul> <li> <a href=""><img src="static/images/tjkc1.jpg" alt=""></a> </li> <li> <a href=""><img src="static/images/tjkc2.jpg" alt=""></a> </li> </ul> <div> <a href=""><img src="static/images/tjkc3.jpg" alt=""></a> <p> <a href="">CI框架30分钟极速入门</a> <br> <span>中级</span><span>49748次播放</span> </p> </div> <div> <a href=""><img src="static/images/tjkc4.jpg" alt=""></a> <p> <a href="">2018前端入门_HTML5</a> <br> <span>初级</span><span>210066次播放</span> </p> </div> </div> <!--最新更新--> <h3>最新更新</h3> <div class="courses-list"> <div> <a href=""><img src="static/images/tjkc3.jpg" alt=""></a> <p> <a href="">Laravel 5.8 中文文档手册</a> <br> <span>Laravel 5.1/5.8速查表:</span> <br> <span>中级</span><span>49748次播放</span> </p> </div> <div> <a href=""><img src="static/images/tjkc4.jpg" alt=""></a> <p> <a href="">JavaScript极速入门</a> <br> <span>本套课程将帮助大家迅速掌握</span> <br> <span>初级</span><span>210066次播放</span> </p> </div> </div> <!--最新文章--> <h3>最新文章</h3> <div class="courses-list1"> <div> <p> <a href=""><span>wamp运行PHP中文乱码</span></a> <br> <span>发布时间:2019-09-11</span> </p> <a href=""><img src="static/images/tjkc4.jpg" alt=""></a> </div> <div> <p> <a href=""><span>wamp运行PHP中文乱码</span></a> <br> <span>发布时间:2019-09-11</span> </p> <a href=""><img src="static/images/tjkc4.jpg" alt=""></a> </div> </div> <!--最新博文--> <h3>最新博文</h3> <div class="courses-list2"> <div> <a href=""><span>wamp运行PHP中文乱码</span></a> <p> <span>2019-09-11</span> </p> </div> <div> <a href=""><span>wamp运行PHP中文乱码</span></a> <p> <span>2019-09-11</span> </p> </div> </div> <!--底部--> <div class="footer"> <ul> <li><a href=""><img src="static/font-icon/zhuye.png" alt=""><br><span>主页</span></a></li> <li><a href=""><img src="static/font-icon/video.png" alt=""><br><span>视频</span></a></li> <li><a href=""><img src="static/font-icon/luntan.png" alt=""><br><span>社区</span></a></li> <li><a href=""><img src="static/font-icon/geren.png" alt=""><br><span>我的</span></a></li> </ul> </div> </body> </html>
点击 "运行实例" 按钮查看在线实例
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号