演示地址:http://php.xmkuyue.com/zuoye/mphp.html
html示例代码:
<!DOCTYPE html>
<html lang="ch-zn">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./static/css2/font-icon.css" />
<link rel="icon" href="./static/img/logo.png">
<title>php中文网移动端首页</title>
</head>
<style>
/* 初始化 */
* {
margin: 0;
padding: 0;
}
a {
text-decoration: none;
color: #888;
}
html {
width: 100vw;
height: 100vh;
font-size: 14px;}
body {
min-width: 360px;
background-color: #EDEFF0;
display: flex;
flex-flow: column nowrap;
}
/* 页眉 */
body > header {
background-color: #2d353c;
color: white;
height: 40px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 15px;
position: fixed;
width: 94vw;
}
header > .iconfont {
font-size: 1.5rem;
}
/* 轮播图 */
body > .slider {
height: 180px;
}
body > .slider >img {
width: 100%;
margin-top: 40px;
}
/* 主导航区 */
nav {
height: 170px;
display: flex;
flex-flow: row wrap;
background-color: white;
box-sizing: border-box;
margin-bottom: 10px;
}
nav > div {
width: 25vw;
display: flex;
flex-flow: column nowrap;
align-items: center;
font-size: 0.9rem;
}
nav > div > a:first-of-type {
text-align: center;
}
nav > div img {
width: 50%;
margin-top: 10px;
}
/* 推荐课程 */
/* 标题 */
.title {
font-size: 1.3rem;
color: #888;
padding-left: 10px;
margin-top: 25px;
box-sizing: border-box;
}
/* 轮播图 */
.r-banner {
margin-top: 6px;
display: flex;
}
.r-banner > a > img {
width: 50vw;
padding: 5px;
box-sizing: border-box;
}
/* 推荐课程第二部分 */
.r-course {
background-color: white;
margin: 15px 10px 10px;
display: flex;
flex-flow: column nowrap;
}
.r-course-desc > a > img {
width: 40vw;
}
.r-course-desc {
display: flex;
margin: 10px;
}
.r-course-desc > a:last-of-type {
padding-left: 10px;
font-size: 1.1rem;
}
/* 最新更新 */
.new-course {
display: flex;
flex-flow: column nowrap;
margin:10px 10px 0;
}
.n-course {
display: flex;
flex-flow: row nowrap;
margin-bottom:10px;
padding: 10px;
background-color: white;
}
.n-course > a > img {
width: 40vw;
}
.n-course-desc {
display: flex;
flex-flow: column nowrap;
padding-left: 10px;
}
.n-course-desc > a:last-of-type{
font-size: 0.8rem;
padding-top: 15px;
}
/* 最新文章 */
.new-article {
display: flex;
flex-flow: column nowrap;
margin: 10px;
}
.n-article > a > img {
width: 25vw;
height: 10vh;
}
.n-article {
background-color: white;
margin-bottom: 10px;
padding: 10px 10px 10px;
display: flex;
}
.new-article-desc {
display: flex;
flex-flow: column nowrap;
width: 65vw;
height: 80px;
}
.new-article-desc > a:last-of-type {
font-size: 0.8rem;
margin-top: 10px;
}
/* 最新博文 */
.bowen {
display: flex;
flex-flow: column nowrap;
}
.desc {
display: flex;
background-color: white;
margin: 10px 10px 0;
height: 35px;
justify-content: space-between;
padding: 10px;
}
/* 最新问答 */
.answer {
display: flex;
flex-flow: column nowrap;
}
.answerdesc {
display: flex;
background-color: white;
margin: 10px 10px 0;
height: 35px;
justify-content: space-between;
padding: 10px;
}
.answerdesc:last-of-type {
margin-bottom: 60px;
}
/* 底部菜单 */
footer {
display: flex;
justify-content: space-around;
background-color: #EDEFF0;
width: 100vw;
height: 50px;
position:fixed;
bottom: 0;
align-items: center;
border-top: 1px solid #8888;
}
.downnav {
display: flex;
flex-flow: column nowrap;
text-align: center;
font-size: 1.1rem;
}
.downnav > a:hover {
color: coral;
}
.iconfont {
font-size: 1.5rem;
}
</style>
<body>
<!-- 页眉 -->
<header>
<span class="iconfont"> </span>
<a href=""><img src="./static/img/logo.png" alt="" width="100" /></a>
<span class="iconfont"> </span>
</header>
<!-- 轮播图 -->
<div class="slider">
<img src="./static/img/banner1.jpg" alt="" />
</div>
<!-- 主导航区 -->
<nav>
<div>
<a href=""><img src="./static/img/nav1.png" alt="" /></a>
<a href="">HTML/CSS</a>
</div>
<div>
<a href=""><img src="./static/img/nav2.png" alt="" /></a>
<a href="">JavaScript</a>
</div>
<div>
<a href=""><img src="./static/img/nav3.png" alt="" /></a>
<a href="">服务端</a>
</div>
<div>
<a href=""><img src="./static/img/nav4.png" alt="" /></a>
<a href="">数据库</a>
</div>
<div>
<a href=""><img src="./static/img/nav5.png" alt="" /></a>
<a href="">移动端</a>
</div>
<div>
<a href=""><img src="./static/img/nav6.png" alt="" /></a>
<a href="">手册</a>
</div>
<div>
<a href=""><img src="./static/img/nav7.png" alt="" /></a>
<a href="">工具</a>
</div>
<div>
<a href=""><img src="./static/img/nav8.png" alt="" /></a>
<a href="">直播</a>
</div>
</nav>
<!-- 推荐课程 -->
<h2 class="title">推荐课程</h2>
<div class="recommend">
<div class="r-banner">
<a href=""><img src="./static/img/r-banner1.jpg" alt="" /></a>
<a href=""><img src="./static/img/r-banner2.jpg" alt="" /></a>
</div>
<div class="r-course">
<div class="r-course-desc">
<a href=""><img src="./static/img/r-course1.jpg" alt="" /></a>
<a href="">CI框架30分钟极速入门</a>
</div>
</div>
<div class="r-course">
<div class="r-course-desc">
<a href=""><img src="./static/img/r-course2.jpg" alt="" /></a>
<a href="">2018前端入门_HTML5</a>
</div>
</div>
</div>
<!-- 最新更新 -->
<h2 class="title">最新更新</h2>
<div class="new-course">
<div class="n-course">
<a href=""><img src="./static/img/n-course1.png" alt="" /></a>
<div class="n-course-desc">
<a href="">PHP快速操控Excel</a>
<a href="">老的PHPExcel已经停止更新了!</a>
</div>
</div>
<div class="n-course">
<a href=""><img src="./static/img/n-course2.png" alt="" /></a>
<div class="n-course-desc">
<a href="">PHP快速操控Excel</a>
<a href="">老的PHPExcel已经停止更新了!</a>
</div>
</div>
<div class="n-course">
<a href=""><img src="./static/img/n-course3.png" alt="" /></a>
<div class="n-course-desc">
<a href="">PHP快速操控Excel</a>
<a href="">老的PHPExcel已经停止更新了!</a>
</div>
</div>
<div class="n-course">
<a href=""><img src="./static/img/n-course4.png" alt="" /></a>
<div class="n-course-desc">
<a href="">PHP快速操控Excel</a>
<a href="">老的PHPExcel已经停止更新了!</a>
</div>
</div>
<div class="n-course">
<a href=""><img src="./static/img/n-course5.png" alt="" /></a>
<div class="n-course-desc">
<a href="">PHP快速操控Excel</a>
<a href="">老的PHPExcel已经停止更新了!</a>
</div>
</div>
<div class="n-course">
<a href=""><img src="./static/img/n-course6.png" alt="" /></a>
<div class="n-course-desc">
<a href="">PHP快速操控Excel</a>
<a href="">老的PHPExcel已经停止更新了!</a>
</div>
</div>
</div>
<!-- 最新文章 -->
<h2 class="title">最新文章</h2>
<div class="new-article">
<div class="n-article">
<div class="new-article-desc">
<a href="">为什么我的电脑只有C盘</a>
<a href="">发布时间:2020-04-11</a>
</div>
<a href=""><img src="./static/img/n-article1.jpg" alt="" /></a>
</div>
<div class="n-article">
<div class="new-article-desc">
<a href="">为什么我的电脑只有C盘</a>
<a href="">发布时间:2020-04-11</a>
</div>
<a href=""><img src="./static/img/n-article2.jpg" alt="" /></a>
</div>
<div class="n-article">
<div class="new-article-desc">
<a href="">为什么我的电脑只有C盘</a>
<a href="">发布时间:2020-04-11</a>
</div>
<a href=""><img src="./static/img/n-article3.jpg" alt="" /></a>
</div>
<div class="n-article">
<div class="new-article-desc">
<a href="">为什么我的电脑只有C盘</a>
<a href="">发布时间:2020-04-11</a>
</div>
<a href=""><img src="./static/img/n-article4.jpg" alt="" /></a>
</div>
<div class="n-article">
<div class="new-article-desc">
<a href="">为什么我的电脑只有C盘</a>
<a href="">发布时间:2020-04-11</a>
</div>
<a href=""><img src="./static/img/n-article5.jpg" alt="" /></a>
</div>
</div>
<!-- 最新博文 -->
<h2 class="title">最新博文</h2>
<div class="bowen">
<div class="desc">
<a href=""><strong>thinkphp5.6源码阅读1</strong></a>
<a href="">2020-04-11</a>
</div>
<div class="desc">
<a href=""><strong>thinkphp5.6源码阅读1</strong></a>
<a href="">2020-04-11</a>
</div>
<div class="desc">
<a href=""><strong>thinkphp5.6源码阅读1</strong></a>
<a href="">2020-04-11</a>
</div>
<div class="desc">
<a href=""><strong>thinkphp5.6源码阅读1</strong></a>
<a href="">2020-04-11</a>
</div>
<div class="desc">
<a href=""><strong>thinkphp5.6源码阅读1</strong></a>
<a href="">2020-04-11</a>
</div>
</div>
<!-- 最新问答 -->
<h2 class="title">最新问答</h2>
<div class="answer">
<div class="answerdesc">
<a href=""><strong>thinkphp5.6源码阅读1</strong></a>
<a href="">2020-04-11</a>
</div>
<div class="answerdesc">
<a href=""><strong>thinkphp5.6源码阅读1</strong></a>
<a href="">2020-04-11</a>
</div>
<div class="answerdesc">
<a href=""><strong>thinkphp5.6源码阅读1</strong></a>
<a href="">2020-04-11</a>
</div>
<div class="answerdesc">
<a href=""><strong>thinkphp5.6源码阅读1</strong></a>
<a href="">2020-04-11</a>
</div>
<div class="answerdesc">
<a href=""><strong>thinkphp5.6源码阅读1</strong></a>
<a href="">2020-04-11</a>
</div>
</div>
<footer>
<div class="downnav">
<span class="iconfont"></span>
<a href="">首页</a>
</div>
<div class="downnav">
<span class="iconfont"></span>
<a href="">视频</a>
</div>
<div class="downnav">
<span class="iconfont"></span>
<a href="">社区</a>
</div>
<div class="downnav">
<span class="iconfont"></span>
<a href="">我的</a>
</div>
</footer>
</body>
</html>