代码
<!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/font-icon.css">
<title>实战php移动端</title>
<style>
/* 初始化 */
* {
margin: 0;
padding: 0;
}
/* 定义文本 */
a {
text-decoration: none;
color: #666;
}
html {
/* vw: 可视区宽度,100vw:表示占满100份 */
width: 100vw;
height: 100vh;
/* vw: 可视区宽度,100vw:表示占满100份 */
font-size: 14px;
}
body {
/* 设置页面拉伸最大值,页面背景色,将body设置为弹性盒子,并设置不能拉升 */
min-width: 360px;
background-color: rgb(250, 227, 227);
display: flex;
flex-flow: column nowrap;
}
body>header {
/* 设置头部背景色,内容色,头部大小,头部弹性盒子,文本内容居中,
文本周围空白区域,元素填充 */
background-color: #2c2e2f;
color: white;
height: 30px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 5px;
/* 将头部绝对定位 */
position: fixed;
width: 97vw;
}
.user {
color: rgb(151, 148, 148);
font-size: 1.7rem;
}
.user1 {
height: 50px;
}
body>.slider {
margin-top: 30px;
height: 160px;
}
.slider>img {
width: 100%;
height: 100%;
}
nav {
height: 200px;
display: flex;
flex-flow: row wrap;
}
nav>div>a {
width: 25vw;
display: flex;
flex-flow: column nowrap;
align-items: center;
margin-top: 12px;
}
nav>div>a :first-of-type {
text-align: center;
}
nav>div img {
width: 50%;
}
h2 {
padding: 3px;
margin-top: 4px;
background-color: lightgray;
font-size: 1.2rem;
color: rgb(68, 68, 67);
display: flex;
align-items: center;
}
main {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
}
main>div>a {
margin-top: 5px;
width: 50vw;
display: flex;
flex-flow: column nowrap;
align-items: center;
}
main>div img {
flex: 1 0 30vw;
width: 95%;
}
.goods-desc {
height: 93.7px;
width: 100vw;
display: flex;
flex-flow: row wrap;
margin-top: 5px;
margin-left: 10px;
}
.teacher {
width: 44vw;
}
.teacher>div {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.goods-desc>div {
width: 45vw;
height: 80px;
}
.goods-desc>div>a img {
display: block;
width: 100%;
height: 100%;
}
.goods-desc>.teacher {
margin-top: 10px;
margin-left: 15px;
font-size: 1rem;
}
.goods-desc>.teacher>div:last-of-type {
margin-top: 5px;
}
.teacher>div:nth-of-type(2) {
margin-top: 5px;
font-size: 0.5rem;
}
.teacher>div:last-of-type {
display: flex;
justify-content: space-between;
padding: 5px 1px;
}
.answer>div {
width: 375px;
}
.answer>div>div {
margin-left: 5vw;
width: 350px;
height: 40px;
box-shadow: 2px 2px 10px #999;
}
.answer>div>div>a {
margin-top: 10px;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
padding: 0 25px;
}
.answer>div>div>a>span:first-of-type {
width: 200px;
font-size: 1.1rem;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.answer>div>div>a>span:last-of-type {
font-size: 0.5rem;
margin-top: 4px;
}
body>footer {
color: rgb(2, 2, 2);
background-color: #c4bfbf;
border: 1px solid rgb(233, 229, 229);
height: 55px;
position: fixed;
bottom: 0;
width: 100vw;
display: flex;
justify-content: space-around;
}
body>footer>a {
margin-top: 10px;
font-size: 1rem;
display: flex;
flex-flow: column nowrap;
align-items: center;
}
.more {
margin-top: 4px;
color: #888888;
display: flex;
font-size: 1rem;
justify-content: center;
}
</style>
</head>
<body>
<!-- 页眉 -->
<header>
<a href=""><span class="iconfont user"></span></a>
<a href=""><img src="images/logo.png" alt="" class="user1"></a>
<a href=""><span class="iconfont user"></span></a>
</header>
<!-- 头部 -->
<div class="slider">
<img src="images/3.jpg" alt="">
</div>
<!-- 菜单 -->
<menu>
<nav>
<div>
<a href=""><img src="images/html.png" alt=""></a>
<a href="">HTML/CSS</a>
</div>
<div>
<a href=""><img src="images/JavaScript.png" alt=""></a>
<a href="">JavaScript</a>
</div>
<div>
<a href=""><img src="images/code.png" alt=""></a>
<a href="">服务端</a>
</div>
<div>
<a href=""><img src="images/sql.png" alt=""></a>
<a href="">数据库</a>
</div>
<div>
<a href=""><img src="images/app.png" alt=""></a>
<a href="">移动端</a>
</div>
<div>
<a href=""><img src="images/manual.png" alt=""></a>
<a href="">手册</a>
</div>
<div>
<a href=""><img src="images/tool2.png" alt=""></a>
<a href="">工具</a>
</div>
<div>
<a href=""><img src="images/live.png" alt=""></a>
<a href="">直播</a>
</div>
</nav>
</menu>
<!-- 推荐课程 -->
<h2 class="tittle">推荐课程</h2>
<main>
<div class="class1">
<a href=""><img src="images/tianlong.jpg" alt=""></a>
</div>
<div class="class1">
<a href=""><img src="images/tianlong.jpg" alt=""></a>
</div>
</main>
<div class="goods-desc">
<div>
<a href=""><img src="images/ci.jpg" alt=""></a>
</div>
<div class="teacher">
<div>
<a href="">CI框架30分钟极速入门</a>
</div>
<div>
<span style="border-radius: 10px; color: white;background-color: rgb(114, 112, 112);">中级</span>
<span style="font-size: 0.8rem;">61329次播放</span>
</div>
</div>
</div>
<div class="goods-desc">
<div>
<a href=""><img src="images/ci.jpg" alt=""></a>
</div>
<div class="teacher">
<div>
<a href="">CI框架30分钟极速入门</a>
</div>
<div>
<span style="border-radius: 10px; color: white;background-color: rgb(114, 112, 112);">中级</span>
<span style="font-size: 0.8rem;">61329次播放</span>
</div>
</div>
</div>
<!-- 最新更新 -->
<h2 class="tittle">最新更新</h2>
<div class="goods-desc">
<div>
<a href=""><img src="images/excel.png" alt=""></a>
</div>
<div class="teacher">
<div>
<a href="">PHP快速操控Excel之PhpSpreadsheet</a>
</div>
<div>
<a href="">老的PHPExcel已经停止更新了!目前最新的是使用phpOffice插件PhpSpreadsheet,用纯 php
编写的库,它提供了一组类,允许您读取和写入不同的电子表格文件格式!php中文网欧阳克老师原创课程!注:PHP运行环境需要PHP7.1以上</a>
</div>
<div>
<span style="border-radius: 10px; color: white;background-color: rgb(114, 112, 112);">中级</span>
<span style="font-size: 0.8rem;">61329次播放</span>
</div>
</div>
</div>
<div class="goods-desc">
<div>
<a href=""><img src="images/thinkphp.png" alt=""></a>
</div>
<div class="teacher">
<div>
<a href="">Thinkphp6.0正式版视频教程</a>
</div>
<div>
<a href="">Thinkphp6.0从2019年10月24日正式发布,相对测试版,有很多变动,目前TP6已经相对比较稳定了,所以php中文网在2020年再次重新录制课程,
帮助快速入门!相关推荐: ThinkPHP6.0完全开发手册(注解版) https://www.php.cn/course/1049.html</a>
</div>
<div>
<span style="border-radius: 10px; color: white;background-color: rgb(114, 112, 112);">中级</span>
<span style="font-size: 0.8rem;">61329次播放</span>
</div>
</div>
</div>
<div class="goods-desc">
<div>
<a href=""><img src="images/Python.jpg" alt=""></a>
</div>
<div class="teacher">
<div>
<a href="">2019python自学视频</a>
</div>
<div>
<a href="">本课程适合想从零开始学习 Python 编程语言的开发人员。由浅入深的带你进入python世界,自学python的一份好课程,兄弟连课程</a>
</div>
<div>
<span style="border-radius: 10px; color: white;background-color: rgb(114, 112, 112);">中级</span>
<span style="font-size: 0.8rem;">61329次播放</span>
</div>
</div>
</div>
<div class="goods-desc">
<div>
<a href=""><img src="images/php.png" alt=""></a>
</div>
<div class="teacher">
<div>
<a href="">PHP开发免费公益直播课</a>
</div>
<div>
<a href="">主讲:php中文网-朱老师( Peter Zhu) 时间:2019.10.17 晚 20:00-22:00 主题:如何高效的学习一门新技术? 具体内容:1. 2020了,
还有哪些值得学习的新技术?
2.如何高效的学习前端开发? 3.如果高效的学习PHP开发?4.phpStudy V8 新功能介绍与演示 5.小皮面板功能介绍</a>
</div>
<div>
<span style="border-radius: 10px; color: white;background-color: rgb(114, 112, 112);">中级</span>
<span style="font-size: 0.8rem;">61329次播放</span>
</div>
</div>
</div>
<div class="goods-desc">
<div>
<a href=""><img src="images/none.jpg" alt=""></a>
</div>
<div class="teacher">
<div>
<a href="">从零开始到WEB响应式布局</a>
</div>
<div>
<a href="">重点介绍了HTML、CSS、web布局前端核心技术,通过视频讲解,了解可以利用HTML+CSS做什么,有相关工具、后端语言,逻辑思维训练等知识点</a>
</div>
<div>
<span style="border-radius: 10px; color: white;background-color: rgb(114, 112, 112);">中级</span>
<span style="font-size: 0.8rem;">61329次播放</span>
</div>
</div>
</div>
<div class="goods-desc">
<div>
<a href=""><img src="images/zero.png" alt=""></a>
</div>
<div class="teacher">
<div>
<a href="">PHP文件基础操作</a>
</div>
<div>
<a href="">好多同学在PHP基础的时候对PHP文件的操作了解的不够多,本节课就带着大家来学习PHP文件的基础操作,
PHP操作文件主要用到的就是PHP文件相关的函数,那么我们主要讲的也就是PHP文件相关的各种函数,相信本节课程会让你对PHP更感兴趣哦!</a>
</div>
<div>
<span style="border-radius: 10px; color: white;background-color: rgb(114, 112, 112);">中级</span>
<span style="font-size: 0.8rem;">61329次播放</span>
</div>
</div>
</div>
<!-- 最近文章 -->
<!-- 最新博客 -->
<!-- 最新问答 -->
<div class="answer">
<h2 class="tittle">最新问答</h2>
<div>
<div>
<a href="">
<a href=""><span>快捷键</span>
<span>2020-4-2</span>
</a>
</a>
</div>
</div>
<div>
<div>
<a href="">
<a href=""><span>后台的模板在哪里找</span>
<span>2020-4-12</span>
</a>
</a>
</div>
</div>
<div>
<div>
<a href="">
<a href=""><span>数据库</span>
<span>2020-4-10</span>
</a>
</a>
</div>
</div>
<div>
<div>
<a href="">
<a href=""><span>如何判断一个变量是否是变量名还是对象名</span>
<span>2020-4-18</span>
</a>
</a>
</div>
</div>
<a class="more">
<p>更多内容</p>
</a>
</div>
<div style="margin-top: 65px;"></div>
<!-- 页脚 -->
<footer>
<a href="">
<span class="iconfont"></span>
<span>首页</span>
</a>
<a href="">
<span class="iconfont"></span>
<span>菜单</span>
</a>
<a href="">
<span class="iconfont"></span>
<span>购物车</span>
</a>
<a href="">
<span class="iconfont"></span>
<span>会员</span>
</a>
</footer>
</body>
</html>
总结