演示链接
http://xuanransoftware.com/phpStudy/0410/
效果图
html示例代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="css/style.css" />
<title>php中文网移动端首页</title>
</head>
<body>
<!-- 页眉部分 -->
<header>
<a href="" class="iconfont"></a>
<a href=""><img src="images/logo.png" alt="" /></a>
<a href="" class="iconfont"></a>
</header>
<!-- 网页主体部分 -->
<main>
<a href=""><img src="images/mainBanner.png" alt="" /></a>
<nav>
<div>
<a href=""><img src="images/navHtml.png" alt="" /></a>
<a href=""><span>HTML/CSS</span></a>
</div>
<div>
<a href=""><img src="images/navJs.png" alt="" /></a>
<a href=""><span>JavaScript</span></a>
</div>
<div>
<a href=""><img src="images/navServer.png" alt="" /></a>
<a href=""><span>服务端</span></a>
</div>
<div>
<a href=""><img src="images/navDb.png" alt="" /></a>
<a href=""><span>数据库</span></a>
</div>
<div>
<a href=""><img src="images/navMobile.png" alt="" /></a>
<a href=""><span>移动端</span></a>
</div>
<div>
<a href=""><img src="images/navManual.png" alt="" /></a>
<a href=""><span>手册</span></a>
</div>
<div>
<a href=""><img src="images/navTool.png" alt="" /></a>
<a href=""><span>工具</span></a>
</div>
<div>
<a href=""><img src="images/navLive.png" alt="" /></a>
<a href=""><span>直播</span></a>
</div>
</nav>
<section class="recomCourse">
<h2>推荐课程</h2>
<div>
<div>
<a href=""><img src="images/course1.png" alt="" /></a>
</div>
<div>
<a href=""><img src="images/course2.png" alt="" /></a>
</div>
</div>
<div>
<div>
<a href=""><img src="images/course3.png" alt="" /></a>
</div>
<div class="desc">
<a href="">CI框架30分钟极速入门</a>
<div>
<span>中级</span>
<span>61215次播放</span>
</div>
</div>
</div>
<div>
<div>
<a href=""><img src="images/course4.png" alt="" /></a>
</div>
<div class="desc">
<a href="">2018前端入门—HTML</a>
<div>
<span>中级</span>
<span>61215次播放</span>
</div>
</div>
</div>
</section>
<section class="recUpdate">
<h2>最近更新</h2>
<div>
<div>
<a href=""><img src="images/update1.png" alt="" /></a>
</div>
<div class="desc">
<a href="">PHP快速操控Excel</a>
<div>
<span>老的PHPExcel已经停止更新了!目前最新的是使用phpOffi</span>
</div>
<div>
<span>初级</span>
<span>61215次播放</span>
</div>
</div>
</div>
<div>
<div>
<a href=""><img src="images/update2.png" alt="" /></a>
</div>
<div class="desc">
<a href="">Thinkphp6.0正式版视频教程</a>
<div>
<span>Thinkphp6.0从2019年10月24日正式发布,相对测试版,有很</span>
</div>
<div>
<span>中级</span>
<span>61215次播放</span>
</div>
</div>
</div>
<div>
<div>
<a href=""><img src="images/update3.png" alt="" /></a>
</div>
<div class="desc">
<a href="">2019python自觉视频</a>
<div>
<span>本课程主要适合从0开始学习python</span>
</div>
<div>
<span>初级</span>
<span>61215次播放</span>
</div>
</div>
</div>
<div>
<div>
<a href=""><img src="images/update4.png" alt="" /></a>
</div>
<div class="desc">
<a href="">PHP开发免费公益直播课</a>
<div>
<span>主讲老师:朱老师</span>
</div>
<div>
<span>初级</span>
<span>61215次播放</span>
</div>
</div>
</div>
<div>
<div>
<a href=""><img src="images/update5.png" alt="" /></a>
</div>
<div class="desc">
<a href="">从零开始到WEB响应式布局</a>
<div>
<span>重点介绍HTML,CSS,web布局</span>
</div>
<div>
<span>中级</span>
<span>61215次播放</span>
</div>
</div>
</div>
<div>
<div>
<a href=""><img src="images/update6.png" alt="" /></a>
</div>
<div class="desc">
<a href="">PHP文件基本操作</a>
<div>
<span>文件的基本操作</span>
</div>
<div>
<span>初级</span>
<span>61215次播放</span>
</div>
</div>
</div>
</section>
<section class="newArticle">
<h2>最新文章</h2>
<div class="desc">
<div>
<a href=""><span>微信引用功能什么意思</span></a>
<a href=""><span>发布时间:2020-04-10</span></a>
</div>
<div>
<a href=""><img src="images/article1.png" alt="" /></a>
</div>
</div>
<div class="desc">
<div>
<a href=""><span>笔记本电脑响怎么解决</span></a>
<a href=""><span>发布时间:2020-04-10</span></a>
</div>
<div>
<a href=""><img src="images/article2.png" alt="" /></a>
</div>
</div>
<div class="desc">
<div>
<a href=""><span>win7如果调整为最佳性能模式</span></a>
<a href=""><span>发布时间:2020-04-10</span></a>
</div>
<div>
<a href=""><img src="images/article3.png" alt="" /></a>
</div>
</div>
<div class="desc">
<div>
<a href=""><span>关于java强引用和弱引用的介绍</span></a>
<a href=""><span>发布时间:2020-04-10</span></a>
</div>
<div>
<a href=""><img src="images/article4.png" alt="" /></a>
</div>
</div>
<div class="desc">
<div>
<a href=""><span>win10无法打开wlan怎么解决</span></a>
<a href=""><span>发布时间:2020-04-10</span></a>
</div>
<div>
<a href=""><img src="images/article5.png" alt="" /></a>
</div>
</div>
<div class="desc">
<div>
<a href=""><span>更多内容</span></a>
</div>
</div>
</section>
<section class="newBlog">
<h2>最新博文</h2>
<div class="desc">
<a href="">跟小黑学漏洞利用开发之windows篇</a>
<a href="">2020-04-10</a>
</div>
<div class="desc">
<a href="">最新的xss bypass代码</a>
<a href="">2020-04-10</a>
</div>
<div class="desc">
<a href="">composer windows安装详解</a>
<a href="">2020-04-10</a>
</div>
<div class="desc">
<a href="">AI智能机器人源码</a>
<a href="">2020-04-10</a>
</div>
<div class="desc">
<a href="">利用css过虑实现网页夜模式</a>
<a href="">2020-04-10</a>
</div>
<div class="desc">
<a href="">更多内容</a>
</div>
</section>
<section class="newAskQue">
<h2>最新问答</h2>
<div class="desc">
<a href="">我访问不了</a>
<a href="">2020-04-10</a>
</div>
<div class="desc">
<a href="">请教一个问题,我想用cut函数</a>
<a href="">2020-04-10</a>
</div>
<div class="desc">
<a href="">验证码输入正确了怎么还提示密码错误</a>
<a href="">2020-04-10</a>
</div>
<div class="desc">
<a href="">手机没有下载SDK</a>
<a href="">2020-04-10</a>
</div>
<div class="desc">
<a href="">访问主页后,创建数据库出现错误1064</a>
<a href="">2020-04-10</a>
</div>
<div class="desc">
<a href="">更多内容</a>
</div>
</section>
</main>
<!-- 页脚部分 -->
<footer>
<a href="" class="iconfont"><span></span><span>首页</span></a>
<a href="" class="iconfont"><span></span><span>视频</span></a>
<a href="" class="iconfont"><span></span><span>社区</span></a>
<a href="" class="iconfont"><span></span><span>我的</span></a>
</footer>
</body>
</html>
css示例代码
@import url(fontIcon.css);
/* 公共样式 */
* {
padding: 0px;
margin: 0px;
}
html {
font-size: 14px;
background-color: #efefef;
}
body {
display: flex;
flex-flow: column nowrap;
justify-content: space-between;
width: 100vw;
height: 100vh;
min-width: 320px;
}
/* 页眉样式 */
header {
display: flex;
background-color: #2d353c;
align-items: center;
justify-content: space-between;
/* position: relative; */
padding: 0px 15px;
height: 35px;
/* top: 0px; */
}
header a {
margin: 0px 10px;
text-decoration: none;
color: white;
}
header a:hover {
color: greenyellow;
}
/* 主体结构样式 */
main {
flex: 1;
overflow-y: scroll;
display: flex;
flex-flow: column nowrap;
}
main > a > img {
width: 100vw;
}
/* 主体结构中的导航栏样式 */
main > nav {
display: flex;
flex-flow: row wrap;
align-items: center;
justify-content: space-around;
background-color: white;
margin-bottom: 10px;
}
main > nav > div {
flex: 0 1 25vw;
display: flex;
flex-flow: column nowrap;
align-items: center;
padding: 10px 0px;
box-sizing: border-box;
}
main > nav > div > img {
flex: 0 1 auto;
}
main > nav > div > a {
flex: 0 1 auto;
text-decoration: none;
font-weight: bold;
color: #938888;
}
main > nav > div > a:hover {
color: coral;
}
/* 页面内容区样式 */
main > section {
display: flex;
flex-flow: column nowrap;
align-items: center;
}
main > section > h2 {
color: #888888;
margin-left: 10px;
margin-bottom: 10px;
font-size: 4.6vw;
align-self: flex-start;
}
/* 推荐课程样式 */
/* 推荐课程只有图片的样式 */
.recomCourse > div:first-of-type {
/* padding: 10px 10px;
box-sizing: border-box; */
width: 95vw;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: space-around;
}
.recomCourse > div:first-of-type > div {
width: 100%;
height: 100%;
}
.recomCourse > div:first-of-type > div > a > img {
max-width: 100%;
max-height: 100%;
}
/* 推荐课程图片+文字描述样式 */
.recomCourse > div:not(:first-of-type) {
padding: 10px 10px;
box-sizing: border-box;
width: 95vw;
background-color: white;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: flex-start;
margin-bottom: 10px;
}
.recomCourse > div:not(:first-of-type) > div > a > img {
max-width: 100%;
max-height: 100%;
}
/* 推荐课程图片左边的描述文字样式 */
.recomCourse > div:not(:first-of-type) > .desc {
flex: 0 1 auto;
height: 100px;
display: flex;
flex-flow: column nowrap;
justify-content: space-around;
margin: 0px 10px;
}
.recomCourse > div:not(:first-of-type) > .desc > a {
text-decoration: none;
color: #888888;
font-size: 3.6vw;
}
.recomCourse > div:not(:first-of-type) > .desc > a:hover {
color: coral;
}
.recomCourse > div:not(:first-of-type) > .desc > div {
font-size: 2.7vw;
color: #888888;
display: flex;
justify-content: space-around;
}
.recomCourse > div:not(:first-of-type) > .desc > div > span:first-of-type {
color: white;
background-color: #737373;
border-radius: 5px;
}
/* 最近更新样式 */
.recUpdate > div {
padding: 10px 10px;
box-sizing: border-box;
width: 95vw;
background-color: white;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: space-around;
margin-bottom: 10px;
}
.recUpdate > div > div {
width: 100%;
height: 100%;
}
.recUpdate > div > div > a > img {
max-width: 100%;
max-height: 100%;
}
/* 最近更新图片左边的描述文字样式 */
.recUpdate > div > .desc {
height: 100px;
display: flex;
flex-flow: column nowrap;
justify-content: space-around;
margin: 0px 10px;
}
.recUpdate > div > .desc {
width: 100%;
height: 100%;
}
.recUpdate > div > .desc > a {
text-decoration: none;
color: #888888;
font-size: 3.6vw;
}
.recUpdate > div > .desc > a:hover {
color: coral;
}
.recUpdate > div > .desc > div {
font-size: 2.7vw;
color: #888888;
display: flex;
justify-content: space-between;
}
.recUpdate > div > .desc > div:last-of-type > span:first-of-type {
color: white;
background-color: #737373;
border-radius: 5px;
}
/* 最新文章样式 */
.newArticle > div {
padding: 10px 10px;
box-sizing: border-box;
width: 95vw;
background-color: white;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.newArticle > div > div {
display: flex;
flex-flow: column nowrap;
justify-content: space-between;
margin-left: 10px;
}
.newArticle > div > div > a {
flex: 0 1 auto;
margin-top: 10px;
text-decoration: none;
color: #888888;
font-size: 3.6vw;
font-weight: bolder;
}
.newArticle > div > div {
width: 100%;
height: 100%;
}
.newArticle > div > div > a > img {
max-width: 100%;
max-height: 100%;
}
.newArticle > div > div > a:hover {
color: coral;
}
.newArticle > div > div > a:last-of-type {
font-size: 2.7vw;
font-weight: normal;
}
/* 最新文章中最后一个“更多内容”的样式 */
.newArticle > div:last-of-type {
display: flex;
justify-content: center;
align-items: center;
height: 30px;
}
.newArticle > div:last-of-type > div > a {
text-decoration: none;
margin-top: 0px;
color: #888888;
font-size: 3.6vw;
font-weight: bolder;
}
.newArticle > div:last-of-type > div > a:hover {
color: coral;
}
/* 最新博文样式 */
.newBlog > div {
padding: 10px 10px;
box-sizing: border-box;
width: 95vw;
background-color: white;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.newBlog > div:last-of-type {
justify-content: center;
}
.newBlog > div > a {
text-decoration: none;
margin-top: 0px;
color: #888888;
font-size: 3.6vw;
font-weight: bolder;
}
.newBlog > div > a:last-of-type {
font-weight: normal;
}
.newBlog > div:last-of-type > a {
font-weight: bolder;
}
.newBlog > div > a:hover {
color: coral;
}
/* 最新问答样式 */
.newAskQue > div {
padding: 10px 10px;
box-sizing: border-box;
width: 95vw;
background-color: white;
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.newAskQue > div:last-of-type {
justify-content: center;
}
.newAskQue > div > a {
text-decoration: none;
margin-top: 0px;
color: #888888;
font-size: 3.6vw;
font-weight: bolder;
}
.newAskQue > div > a:last-of-type {
font-weight: normal;
}
.newAskQue > div:last-of-type > a {
font-weight: bolder;
}
.newAskQue > div > a:hover {
color: coral;
}
/* 页脚样式 */
footer {
display: flex;
align-items: center;
justify-content: space-around;
background-color: #eeeeee;
height: 35px;
/* position: relative; */
/* bottom: 0px; */
}
footer > a {
text-decoration: none;
color: #737373;
}
footer > a > span {
font-size: 3.6vw;
}
footer > a:hover {
color: coral;
}