结合所学知识写了整整一天,感觉还有很多的问题,最上面的LOGO条和最下面的倒是固定住了,但是都会把内容遮住,还没有搞明白。
终于有一点眉目了,很开心,感谢老师的精心教授!
flex的容器部分的学习已经感觉有点清晰了,项目的属性设置还有些问题,还要继续巩固。
代码及效果图
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="static/css/font-icon.css">
<style>
* {
margin: 0;
padding: 0;
}
html {
width: 100vh;
/* height: 100vh; */
}
body {
width: 98.5vw;
/* min-width: 450px; */
box-sizing: border-box;
margin: 0;
padding: 5px;
display: flex;
flex-flow: column nowrap;
font-size: 18px;
/* align-items: center; */
}
a {
color: #000000;
/* font-size: 12px; */
text-decoration: none;
}
a:hover {
color: lightseagreen;
}
header>img {
width: 100px;
}
header {
padding: 0 10px;
background-color: black;
color: #ffffff;
position: fixed;
/* top: 0; */
width: 96vw;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
}
.logofont {
font-size: 20px;
}
.slide>img {
/* margin: 2px; */
width: 100%;
}
nav {
/* margin-top: 10px; */
display: flex;
flex-flow: row wrap;
justify-content: center;
height: 200px;
/* font-size: 1.0rem; */
}
nav>div a {
font-size: 1rem;
}
nav>div {
width: 25%;
}
nav>div>a>img {
width: 50px;
}
nav>div {
display: flex;
flex-flow: column nowrap;
align-items: center;
justify-content: center;
font-size: 1.5rem;
/* align-self: stretch; */
/* flex: 1 1 auto; */
}
nav>div>a {
/* flex: 1 1 auto; */
}
h2 {
font-size: 1.2rem;
}
.hotclass>.hotclasspic {
/* width: 95vw; */
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
}
.hotclass>.hotclasspic>a>img {
width: 48vw;
height: 9vh;
/* padding:0 10px; */
}
.hotclass>.hotclasstxt>.hotclasslist>a img {
width: 45vw;
height: 8vh;
}
.hotclasstxt {
justify-content: center;
}
.hotclasstxt {
padding: 5px;
margin-top: 10px;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
}
.hotclasslist {
/* flex-grow: 1; */
}
.hotclasslisttxt {
/* flex-grow: 2; */
/* width: 50vw; */
/* flex: 1; */
}
.hotclasslisttxt {
padding: 10px;
display: flex;
flex-flow: column nowrap;
}
.hotclassgrade>span {
font-size: 0.7rem;
}
.hotclassgrade>span:first-of-type {
color: seashell;
background-color: #666666;
border-radius: 5px;
}
.newclass>img {
width: 45vw;
height: 8vh;
}
.newclass {
padding: 5px;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
}
.newclass>.newupdatetext {
/* padding: 10px; */
margin-left: 10px;
display: flex;
flex-flow: column nowrap;
justify-content: space-around;
}
.newupdatetext>span>i:first-of-type {
background-color: #000;
color: #ffffff;
padding: 3px;
border-radius: 5px;
}
.newupdatetext>span:last-of-type {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
}
h5 {
text-align: center;
color: #9e9a9a;
}
.newarticle {
padding: 5px;
box-shadow: 1px 1px 10px 5px #d8d5d5;
/* width: 89vw; */
/* border: 1 solid red; */
}
.newarticle>span>i {
font-size: 0.8rem;
}
.newarticle>span>img {
width: 45vw;
}
.newarticle {
margin-top: 15px;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
}
.newarticle>span:first-of-type {
display: flex;
flex-flow: column nowrap;
}
.newarticle>span>p:first-of-type {
font-size: 1.0rem;
}
.newarticle>span>p:last-of-type {
font-size: 0.8rem;
}
.newblog {
margin-top: 10px;
width: 97vw;
box-shadow: 1px 1px 10px 5px #d8d5d5;
padding: 10px;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
}
.newblog>span:first-of-type {
font-size: 0.8rem;
}
.newblog>span:last-of-type {
font-size: 0.7rem;
}
.newqa {
margin-top: 10px;
width: 97vw;
box-shadow: 0px 1px 10px 5px #d8d5d5;
padding: 10px;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
}
.newqa>span:first-of-type {
font-size: 0.8rem;
}
.newqa>span:last-of-type {
font-size: 0.7rem;
}
footer {
width: 99vw;
height: 60px;
background-color: #9e9e9e;
display: flex;
flex-flow: row nowrap;
justify-content: space-around;
position: fixed;
bottom: 0;
}
footer>a {
display: flex;
flex-flow: column nowrap;
justify-content: center;
align-items: center;
}
footer>a>span:first-of-type {
font-size: 1.6rem;
}
footer>a>span:last-of-type {
font-size: 1rem;
}
</style>
</head>
<body>
<!-- 顶部 -->
<header>
<div class="iconfont logofont"></div>
<img src="static/images/logo.png" alt="">
<div class="iconfont logofont"></div>
</header>
<!-- 轮播图 -->
<div class="slide"><img src="static/images/11.png" alt=""></div>
<!-- 导航 -->
<nav>
<div>
<a href=""><img src="static/images/html.png" alt=""></a>
<a href="">HTML/CSS</a>
</div>
<div>
<a href=""><img src="static/images/JavaScript.png" alt=""></a>
<a href="">JavaScript</a>
</div>
<div>
<a href=""><img src="static/images/code.png" alt=""></a>
<a href="">服务器</a>
</div>
<div>
<a href=""><img src="static/images/sql.png" alt=""></a>
<a href="">数据库</a>
</div>
<div>
<a href=""><img src="static/images/app.png" alt=""></a>
<a href="">移动端</a>
</div>
<div>
<a href=""><img src="static/images/manual.png" alt=""></a>
<a href="">手册</a>
</div>
<div>
<a href=""><img src="static/images/tool2.png" alt=""></a>
<a href="">工具</a>
</div>
<div>
<a href=""><img src="static/images/live.png" alt=""></a>
<a href="">直播</a>
</div>
</nav>
<!-- 推荐课程 -->
<h2>推荐课程</h2>
<div class="hotclass">
<div class="hotclasspic">
<a href=""><img src="static/images/hotcalss.jpg" alt=""></a>
<a href=""><img src="static/images/hotcalss.jpg" alt=""></a>
</div>
<div class="hotclasstxt">
<div class="hotclasslist">
<a href=""><img src="static/images/ci30.jpg" alt=""></a>
</div>
<div class="hotclasslisttxt">
<a href="" style="font-size: 1rem;">CI框架30分钟极速入门</a>
<div class="hotclassgrade">
<span>中级</span> <span>61302次播放</span>
</div>
</div>
</div>
<div class="hotclasstxt">
<div class="hotclasslist">
<a href=""><img src="static/images/2018frt.jpg" alt=""></a>
</div>
<div class="hotclasslisttxt">
<a href="" style="font-size: 1rem;">2018前端入门_HTML5</a>
<div class="hotclassgrade">
<span>初级</span> <span>30637次播放</span>
</div>
</div>
</div>
</div>
<!-- 最新更新 -->
<h2>最新更新</h2>
<div class="newclass">
<div class="newupdate">
<a href=""><img src="static/images/n1.png" style="width: 45vw;height: 8vh;" alt=""></a>
</div>
<div class="newupdatetext">
<span><a href="" style="font-size: 1.0rem;">PHP快速操控Excel之PhpS</a></span>
<span style="font-size: 0.8rem;">老的PHPExcel已经停止更新了!目前最新的</span>
<span><i style="font-size: 0.6rem;">初级</i><i style="font-size: 0.6rem;">15203次播放</i></span>
</div>
</div>
<div class="newclass">
<div class="newupdate">
<a href=""><img src="static/images/n2.png" style="width: 45vw;height: 8vh;" alt=""></a>
</div>
<div class="newupdatetext">
<span><a href="" style="font-size: 1.0rem;">Thinkphp6.0正式版视频教程</a></span>
<span style="font-size: 0.8rem;">老的PHPExcel已经停止更新了!目前最新的</span>
<span><i style="font-size: 0.6rem;">初级</i><i style="font-size: 0.6rem;">15203次播放</i></span>
</div>
</div>
<div class="newclass">
<div class="newupdate">
<a href=""><img src="static/images/n3.jpg" style="width: 45vw;height: 8vh;" alt=""></a>
</div>
<div class="newupdatetext">
<span><a href="" style="font-size: 1.0rem;">2019python自学视频</a></span>
<span style="font-size: 0.8rem;">老的PHPExcel已经停止更新了!目前最新的</span>
<span><i style="font-size: 0.6rem;">初级</i><i style="font-size: 0.6rem;">15203次播放</i></span>
</div>
</div>
<div class="newclass">
<div class="newupdate">
<a href=""><img src="static/images/n4.png" style="width: 45vw;height: 8vh;" alt=""></a>
</div>
<div class="newupdatetext">
<span><a href="" style="font-size: 1.0rem;">PHP开发免费公益直播课</a></span>
<span style="font-size: 0.8rem;">老的PHPExcel已经停止更新了!目前最新的</span>
<span><i style="font-size: 0.6rem;">初级</i><i style="font-size: 0.6rem;">15203次播放</i></span>
</div>
</div>
<div class="newclass">
<div class="newupdate">
<a href=""><img src="static/images/n5.png" style="width: 45vw;height: 8vh;" alt=""></a>
</div>
<div class="newupdatetext">
<span><a href="" style="font-size: 1.0rem;">从零开始到WEB响应式布局</a></span>
<span style="font-size: 0.8rem;">老的PHPExcel已经停止更新了!目前最新的</span>
<span><i style="font-size: 0.6rem;">初级</i><i style="font-size: 0.6rem;">15203次播放</i></span>
</div>
</div>
<div class="newclass">
<div class="newupdate">
<a href=""><img src="static/images/n6.png" style="width: 45vw;height: 8vh;" alt=""></a>
</div>
<div class="newupdatetext">
<span><a href="" style="font-size: 1.0rem;">PHP文件基础操作</a></span>
<span style="font-size: 0.8rem;">老的PHPExcel已经停止更新了!目前最新的</span>
<span><i style="font-size: 0.6rem;">初级</i><i style="font-size: 0.6rem;">15203次播放</i></span>
</div>
</div>
<h2>最新文章</h2>
<div class="newarticle">
<span>
<p><a href="">PS怎么保存调好的预设??</a></p>
<p>发布时间:2020-1-13</p>
</span>
<span><a href=""><img src="static/images/a1.jpg" alt="" style="widows: 45vw;height: 8vh;"></a></span>
</div>
<div class="newarticle">
<span>
<p><a href="">3dmax2014怎么切换中文版</a></p>
<p>发布时间:2020-1-13</p>
</span>
<span><a href=""><img src="static/images/a2.jpg" alt="" style="widows: 45vw;height: 8vh;"></a></span>
</div>
<div class="newarticle">
<span>
<p><a href="">身份证复制粘贴到exls后显示E+17怎么办</a></p>
<p>发布时间:2020-1-13</p>
</span>
<span><a href=""><img src="static/images/a3.jpg" alt="" style="widows: 45vw;height: 8vh;"></a></span>
</div>
<div class="newarticle">
<span>
<p><a href="">windows电脑提示已关闭无线功能怎么</a></p>
<p>发布时间:2020-1-13</p>
</span>
<span><a href=""><img src="static/images/a4.jpg" alt="" style="widows: 45vw;height: 8vh;"></a></span>
</div>
<div class="newarticle">
<span>
<p><a href="">msc是什么</a></p>
<p>发布时间:2020-1-13</p>
</span>
<span><a href=""><img src="static/images/a5.jpg" alt="" style="widows: 45vw;height: 8vh;"></a></span>
</div>
<h5>更多内容</h5>
<!-- 最新博文 -->
<h2>最新博文</h2>
<div class="newblog">
<span>细说选择器:简单选择器、上下文选择器、</span>
<span>2020-04-13</span>
</div>
<div class="newblog">
<span>CSS 中各类选择器的属性及应用</span>
<span>2020-04-13</span>
</div>
<div class="newblog">
<span>CSS3:弹性盒子flex布局</span>
<span>2020-04-13</span>
</div>
<div class="newblog">
<span>flex容器中的主轴方向与项目换行缩写、主</span>
<span>2020-04-13</span>
</div>
<div class="newblog">
<span>Jquery+AJAX上传文件,无刷新上传并重</span>
<span>2020-04-13</span>
</div>
<h5>更多内容</h5>
<!-- 最新问答 -->
<h2>最新问答</h2>
<div class="newqa">
<span>为什么老师,你de button按钮处可以有</span>
<span>2020-04-13</span>
</div>
<div class="newqa">
<span>url访问admin下的控制器的方法,有问题</span>
<span>2020-04-13</span>
</div>
<div class="newqa">
<span>php+workerman实现新订单提示语音</span>
<span>2020-04-13</span>
</div>
<div class="newqa">
<span>不出现tp6.0页面</span>
<span>2020-04-13</span>
</div>
<div class="newqa">
<span>数据库密码··</span>
<span>2020-04-13</span>
</div>
<h5>更多内容</h5>
<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>