Flex布局仿PHP中文网
效果图如下:
HTML&DOM结构:
<!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="./static/css/common.css" />
<link rel="stylesheet" href="./static/css/style.css" />
<title>Document</title>
</head>
<body>
<!-- 头部 -->
<div class="header">
<div class="nav flexDis flexAlignC">
<div class="logo"></div>
<ul>
<li><a href="">首页</a></li>
<li><a href="">视频教程</a></li>
<li><a href="">入门教程</a></li>
<li><a href="">社区问答</a></li>
<li><a href="">技术文章</a></li>
<li><a href="">资源下载</a></li>
<li><a href="">编程词典</a></li>
<li><a href="">工具下载</a></li>
<li><a href="">PHP培训</a></li>
</ul>
<p><a href="">注册</a><a href="">登录</a></p>
</div>
</div>
<!-- 主体 -->
<div class="top container flexDis">
<div class="menuList">
<ul>
<li>
<a href="">PHP开发<span>></span></a>
</li>
<li>
<a href="">前端开发<span>></span></a>
</li>
<li>
<a href="">服务端开发<span>></span></a>
</li>
<li>
<a href="">移动开发<span>></span></a>
</li>
<li>
<a href="">数据库<span>></span></a>
</li>
<li>
<a href="">服务器运维&下载<span>></span></a>
</li>
<li>
<a href="">在线工具箱<span>></span></a>
</li>
<li>
<a href="">常用类库<span>></span></a>
</li>
</ul>
</div>
<div class="viewAd">
<div class="search">
<a href="">PHP头条</a><span class="span1">新</span>
<a href="">孤独九贱</a>
<a href="">学习路线</a><span class="span2">新</span>
<a href="">在线工具</a>
<a href="">趣味课堂</a><span class="span3">新</span>
<a href="">社区问答</a>
<a href="">课程直播</a>
<span class="searchInput">
<input type="text" placeholder="输入关键字搜索" /><a href="">搜</a>
</span>
</div>
<div class="viewImg">
<img src="./static/img/b1.png" alt="" />
</div>
<div class="adImg flexDis flexAlignC flexContentA">
<p>
<a href=""><img src="./static/img/1.jpg" alt="" /></a>
</p>
<p>
<a href=""><img src="./static/img/2.png" alt="" /></a>
</p>
<p>
<a href=""><img src="./static/img/3.jpg" alt="" /></a>
</p>
<p>
<a href=""><img src="./static/img/4.jpg" alt="" /></a>
</p>
</div>
</div>
</div>
<!-- AD -->
<div class="ad1 container">
<a href=""> <img src="./static/img/index_ad222.jpg" alt="" /></a>
</div>
<!-- 内容1 -->
<div class="content1 container flexDis">
<!-- 内容-左-->
<div class="left">
<h4> 头条</h4>
<p><a href="">php中文网原创视频:《天龙八部》公益ph...</a></p>
<p><a href="">php中文网《玉女心经》公益PHP培训系列...</a></p>
<p><a href="">php的版本发展历史(1995-2020)</a></p>
<p><a href="">您知道吗?最好的语言:PHP 25 岁了!</a></p>
<p><a href=""></php>史上最污技术解读,我竟然秒懂了</a></p>
<p><a href="">2020年最新5个简洁优秀的个人博客模板免...</a></p>
<p><a href="">5款优秀的vue后台管理系统模板推荐(免...</a></p>
<p><a href="">6个大气的bootstrap后台管理系统模板推荐...</a></p>
<p><a href="">5款简洁的layui后台管理模板推荐(免费下...</a></p>
<p><a href="">5款个性的网页回到顶部特效代码</a></p>
<p><a href="">小皮面板 v0.53 版本今日发布!</a></p>
<p><a href="">phpstudy v8.1.0.4 版本今日发布!</a></p>
</div>
<!-- 内容-中-->
<div class="main flexGrowAuto">
<h4> 最新课程</h4>
<ul class="flexDis flexWrap ">
<li>
<a href="">
<div><img src="./static/img/11.jpg" alt=""></div>
<div><span>中级</span>PHP代码整洁之道</div>
</a>
</li>
<li>
<a href="">
<div><img src="./static/img/22.png" alt=""></div>
<div><span>初级</span>前端课程(五郞八卦棍系列)第一棍:HTML5</div>
</a>
</li>
<li>
<a href="">
<div><img src="./static/img/33.png" alt=""></div>
<div><span>初级</span>小皮面板使用视频教程</div>
</a>
</li>
<li>
<a href="">
<div><img src="./static/img/44.png" alt=""></div>
<div><span>初级</span>从零进入C语言</div>
</a>
</li>
<li>
<a href="">
<div><img src="./static/img/55.png" alt=""></div>
<div><span>中级</span>C语言进阶篇</div>
</a>
</li>
<li>
<a href="">
<div><img src="./static/img/66.png" alt=""></div>
<div><span>中级</span>PHP快速操控Excel之PhpSpreadsheet</div>
</a>
</li>
</ul>
</div>
<!-- 内容-右-->
<div class="right">
<h4> 常用手册</h4><h4><a href="">更多</a></h4>
<ul >
<li class="flexDis">
<div class="rightImg">
<img src="./static/img/php.png" alt="">
</div>
<div class="rightFont flexDis flexWrap flexAlignC">
<a href="">PHP手册</a>
<a href="">Linux手册</a>
<a href="">ThinkPHP6.0</a>
<a href="">CI手册大全</a>
</div>
</li>
<li class="flexDis">
<div class="rightImg">
<img src="./static/img/js.png" alt="">
</div>
<div class="rightFont flexDis flexWrap flexAlignC">
<a href="">JavaScript中文参考手册</a>
<a href="">jQuery手册大全</a>
</div>
</li>
<li class="flexDis">
<div class="rightImg">
<img src="./static/img/mysql.png" alt="">
</div>
<div class="rightFont flexDis flexWrap flexAlignC">
<a href="">MySQL参考手册大全</a>
<a href="">laravel5.8速查表</a>
</div>
</li>
<li class="flexDis">
<div class="rightImg">
<img src="./static/img/python.png" alt="">
</div>
<div class="rightFont flexDis flexWrap flexAlignC">
<a href="">Python参考手册大全</a>
<a href="">Node.js中文学习手册</a>
</div>
</li>
<li class="flexDis">
<div class="rightImg">
<img src="./static/img/html.png" alt="">
</div>
<div class="rightFont flexDis flexWrap flexAlignC">
<a href="">html手册</a>
<a href="">CSS手册</a>
<a href="">AngularJS</a>
<a href="">Ajax手册</a>
</div>
</li>
<li class="flexDis">
<div class="rightImg">
<img src="./static/img/asp.jpg" alt="">
</div>
<div class="rightFont flexDis flexWrap flexAlignC">
<a href="">ASP参考手册大全</a>
<a href="">Bootstrap3参考手册</a>
</div>
</li>
</ul>
</div>
</div>
<div class="content2 container flexDis flexContentB">
<div class="content_ad_down">
<div class="content_ad">
<img src="./static/img/ad01.jpg" alt="">
<a href=""> phpStudy极速入门视频教程</a>
<span></span>
<span></span>
<span></span>
</div>
<div class="content_down">
<div class="down_title"><span><a href="">更多>></a> </span>php开发辅助工具下载</div>
<div class="down_content">
<ul>
<li><span>8-17</span><a href="">小皮面板(phpStudy for Linux 服务器运维管理</a></li>
<li><span>8-17</span><a href="">VSCode Windows 64位 下载</a></li>
<li><span>8-17</span><a href="">Memcached Win64位系统 1.4.4版本</a></li>
<li><span>8-17</span><a href="">Memcached Win32位系统 1.4.4版本</a></li>
<li><span>8-17</span><a href="">Memcached Win64位系统 1.4.5版本</a></li>
<li><span>8-17</span><a href="">Memcached Win32位系统 1.4.5版本</a></li>
<li><span>8-17</span><a href="">phpstudy安全自检修复程序</a></li>
<li><span>8-17</span><a href="">phpStudy V8.1(Win64位)</a></li>
<li><span>8-17</span><a href="">phpStudy V8.1(Win32位)</a></li>
</ul>
</div>
</div>
</div>
<div class="content_arc">
<div class="arc_title">
<span>技术文章</span>
<span>网站源码</span>
<span>原生手册</span>
<span>推荐博文</span>
</div>
<div class="arc_content">
<ul>
<li><span>php教程</span><span>|</span><a href="">什么是逆波兰式?</a><span>2020-06-24 </span></li>
<li><span>PHP7</span><span>|</span><a href="">学习PHP7的革新与性能优化</a><span>2020-06-24 </span></li>
<li><span>mysql教程</span><span>|</span><a href="">什么是逆波兰式?</a><span>2020-06-24 </span></li>
<li><span>Laravel</span><span>|</span><a href="">Laravel 如何包含自己的助手函数?</a><span>2020-06-24 </span></li>
<li><span>ThinkPHP</span><span>|</span><a href="">ThinkPHP 6.0 多语言优化扩展包的安装与使</a><span>2020-06-23 </span></li>
<li><span>css教程</span><span>|</span><a href="">css3新增伪类有哪些</a><span>2020-06-24 </span></li>
<li><span>js教程</span><span>|</span><a href="">ES6 Generator 基本使用</a><span>2020-06-24 </span></li>
<li><span>Redis</span><span>|</span><a href="">Redis集群中的节点分为哪两个</a><span>2020-06-24 </span></li>
<li><span>小程序开发</span><span>|</span><a href="">什么是骨架屏(Skeleton Screen)?</a><span>2020-06-24 </span></li>
<li><span>Python教</span><span>|</span><a href="">Python 如何自定义模块?</a><span>2020-06-24 </span></li>
<li><span>Python教</span><span>|</span><a href="">Python 的 help 函数使用</a><span>2020-06-24 </span></li>
<li><span>Java基础</span><span>|</span><a href="">Java Reactor 反应器模式</a><span>2020-06-24 </span></li>
<li><span>C#.Net教</span><span>|</span><a href="">C++语言标识符的命名规则是什么?</a><span>2020-06-24 </span></li>
<li><span>Golang</span><span>|</span><a href="">Go Wails 框架构建桌面应用示例</a><span>2020-06-24 </span></li>
<li><span>Docker</span><span>|</span><a href="">docker是什么?有什么作用?</a><span>2020-06-24 </span></li>
<li><span>PHP问题</span><span>|</span><a href="">PHP中 fsockopen 函数怎么用?</a><span>2020-06-24 </span></li>
<li><span>Apache</span><span>|</span><a href="">如何在centos下安装apache</a><span>2020-06-24 </span></li>
<li><span>Nginx</span><span>|</span><a href="">nginx实现负载均衡有哪几个模式</a><span>2020-06-24 </span></li>
</ul>
</div>
</div>
<div class="content_qa">
<div class="qa_title"><span>社区问答</span></div>
<div class="qa_content">
<ul>
<li><a href="">总是显示密码错误,登录不了</a></li>
<li><a href="">朱老师用的什么屏幕截取软件?</a></li>
<li><a href="">请问jQuery按手机返回键后,不回退页面...</a></li>
<li><a href="">PHP7 编译安装 扩展相关问题</a></li>
<li><a href="">90%22=2 这个是怎么个模法?</a></li>
<li><a href="">页面中iframe内元素点击</a></li>
<li><a href="">朱老师, 这个地方按你的分类列表出不来...</a></li>
<li><a href="">朱老师,第6章后是不是还有内容啊</a></li>
<li><a href="">发帖后,再进行修改,帖子时间是第一次...</a></li>
<li><a href="">think目录下没有Db目录</a></li>
<li><a href="">只能访问index,不能访问hello</a></li>
<li><a href="">编辑页面出不来</a></li>
<li><a href="">关键词打开网站很慢怎么解决</a></li>
<li><a href="">登录不能跳转到后台</a></li>
<li><a href="">访问中心服务器错误</a></li>
</ul>
</div>
</div>
</div>
<!-- ad:phpStudy -->
<div class="ad2 container"><a href=""><img src="./static/img/phpstudy.jpg" alt=""></a></div>
<!-- 词典搜索 -->
<div class="search-related container flexDis">
<div class="related_type">
<div class="type_title">词典分类</div>
<div class="type_content">
<ul>
<li><a href=""><i></i> HTML/CSS<span>HTML/CSS</span></a></li>
<li><a href=""><i></i>JavaScript<span>JavaScript</span></a></li>
<li><a href=""><i></i>服务端<span>服务端</span></a></li>
<li><a href=""><i></i>数据库<span>数据库</span></a></li>
<li><a href=""><i></i>移动端<span>移动端</span></a></li>
<li><a href=""><i></i>XML<span>XML</span></a></li>
<li><a href=""><i></i>ASP.NET<span>ASP.NET</span></a></li>
<li><a href=""><i></i>Web Services<span>Web Services</span></a></li>
<li><a href=""><i></i>开发工具<span>开发工具</span></a></li>
<li><a href=""><i></i>网站建设<span>网站建设</span></a></li>
</ul>
</div>
</div>
<div class="related_search">
<div class="search_title flexDis"><a href="">词典查询</a><a href="">全部词典</a><a href="">最近更新</a></div>
<div class="search_content flexDis flexDir-y">
<div class="sc_title">编程词典</div>
<div class="sc_title2">服务码农的在线技术手册</div>
<div class="search_div">
<span>图</span>
<span><input type="text" placeholder="请输入搜索内容"></span>
<span><button>搜索</button></span>
</div>
<div class="hot_key">热门搜索:<span>PHP</span><span>MySQL</span><span>jquery</span><span>HTML</span><span>CSS</span></div>
<div class="ls_key">历史搜索:</div>
</div>
</div>
</div>
<!-- 内容3 -->
<div class="content3 container ">
<div class="content3_title">php入门精品课程</div>
<div class="content3_content flexDis">
<div class="content_left">
<div class="ct3_left_ad"><img src="./static/img/index_learn_first.jpg" alt=""></div>
<ul>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
</ul>
</div>
<div class="content_right ">
<ul class="flexDis flexWrap flexContentB flexAlignT">
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
<li>
<img src="./static/img/thinkphp.jpg" alt="">
<a href="">ThinkPHP6.0极速入门(视频教程)</a>
<span>4W+次播放</span>
</li>
</ul>
</div>
</div>
</div>
<!-- 底部 -->
<div class="footer">
<div class="footer_left container">
<p class="footer_link">
<a href="">网站首页</a>
<a href="">PHP视频</a>
<a href="">PHP代码</a>
<a href="">PHP手册</a>
<a href="">词条手记</a>
<a href="">编程词典</a>
</p>
<p class="footer_company">
<span>php中文网:公益在线php培训,帮助PHP学习者快速成长!</span>
<img src="./static/img/label_lg_90030.png" alt=""> 合肥彼岸互联信息技术有限公司
</p>
<p class="copyright">
Copyright 2014-2020 php.cn All Rights Reserved | 皖B2-20150071-9
<img src="./static/img/foot_line.gif" alt="">
皖公网安备 34010402701654号
<img src="./static/img/foot_line.gif" alt="">
<a href="">关于我们</a>
<a href="">免责申明</a>
<a href="">赞助与捐赠</a>
<a href="">广告合作</a>
</p>
<p class="add_tel">座机号码:0551-64933227 安徽省合肥市政务新区置地广场D座2101</p>
<div class="code">
<img src="./static/img/code1.png" alt="">
<img src="./static/img/code2.jpg" alt="">
</div>
</div>
</div>
</body>
</html>
CSS样式:
.header {
max-height: 60px;
font-size: 1em;
}
.header .logo {
display: block;
height: 60px;
width: 140px;
background: url("../img/logo.png") no-repeat center;
background-size: 100%;
margin-left: 2em;
}
.header .nav {
background: #000;
}
.header .nav ul {
padding: 0 1.6em;
margin: 0 3em;
}
.header .nav ul li {
display: inline-block;
}
.header .nav ul li a {
display: inline-block;
text-align: center;
width: 85px;
height: 60px;
line-height: 60px; /* 文本垂直居中 */
color: rgba(255, 255, 255, 0.7);
}
.header .nav ul li:first-of-type {
background-color: #363c41;
}
.header .nav ul li a:hover {
color: rgba(255, 255, 255, 1);
border-bottom: 5px solid #5fb878;
}
.header .nav p {
margin-left: auto;
}
.header .nav p a {
display: inline-block;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
color: rgba(255, 255, 255, 0.7);
}
.header .nav p a:hover {
background: #363c41;
}
.top {
height: 510px;
/* border: 5px solid red; */
/* padding: 1em 0; */
margin-top: 20px;
}
.top .menuList {
width: 210px;
/* border: 5px solid blue; */
background: #2b333b;
border-top-left-radius: 0.8em;
border-bottom-left-radius: 0.8em;
}
.top .menuList li {
position: relative;
}
.top .menuList a {
display: inline-block;
width: 100%;
color: rgba(255, 255, 255, 0.8);
margin-top: 0.8em;
padding: 0.85em 1.5em;
font-size: 1.1em;
}
.top .menuList a:hover {
background: rgba(255, 255, 255, 0.2);
}
.top .menuList span {
color: rgba(255, 255, 255, 0.8);
position: absolute;
top: 45%;
right: 10%;
}
/* 搜索 */
.top .search {
background: #fff;
height: 60px;
/* width: 990px; */
border-top-right-radius: 0.8em;
box-shadow: 0 0.2em 0.4em rgba(0, 0, 0, 0.2);
line-height: 60px;
position: relative;
}
.top .search a {
color: #333;
margin: 0 18px;
}
.top .search .span1 {
color: #fff;
background: #ff5722;
border-radius: 0.2em;
position: absolute;
top: 32%;
left: 7.5%;
width: 20px;
height: 20px;
text-align: center;
line-height: 20px;
}
.top .search .span2 {
color: #fff;
background: #2f4056;
border-radius: 0.2em;
position: absolute;
top: 32%;
left: 26.8%;
width: 20px;
height: 20px;
text-align: center;
line-height: 20px;
}
.top .search .span3 {
color: #fff;
background: #ffb800;
border-radius: 0.2em;
position: absolute;
top: 32%;
left: 46%;
width: 20px;
height: 20px;
text-align: center;
line-height: 20px;
}
.top .search .searchInput {
position: absolute;
top: 20%;
right: 20px;
width: 270px;
height: 40px;
background: #f1f0f0;
line-height: 40px;
border-radius: 0.2em;
}
.top .searchInput:hover {
border-bottom: 1px solid silver;
}
.top .searchInput input {
width: 210px;
height: 40px;
outline: none;
/* vertical-align: middle; */
background: none;
border: none;
margin-left: 10px;
}
.top .viewImg {
box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);
}
.top .viewAd .adImg {
height: 110px;
background: rgba(255, 255, 255, 1);
border-bottom-right-radius: 0.8em;
box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);
margin-top: -2px;
}
.top .viewAd .adImg img {
border-radius: 0.8em;
}
.ad1 img {
margin: 20px 0;
border-radius: 0.8em;
}
.ad2 img {
margin-bottom: 10px;
border-radius: 0.8em;
}
/* 内容1 */
.content1 {
height: 415px;
}
.content1 h4 {
color: #343535;
border-bottom: 1px dotted #e9e9e9;
padding: 5px;
/* height: 30px; */
}
.content1 .left {
background: rgba(255, 255, 255, 1);
box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);
border-radius: 0.8em;
padding: 10px;
width: 300px;
}
/* .content1 .left h4{
color: #343535;
border-bottom: 1px dotted #e9e9e9;
padding: 5px;
} */
.content1 .left p {
margin: 10px 0;
}
.content1 .left p a {
margin: 115px 0;
color: #333;
}
.content1 .left p a:hover {
color: #777;
}
.content1 .right {
background: rgba(255, 255, 255, 1);
box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);
padding: 10px;
border-radius: 0.8em;
width: 260px;
position: relative;
}
.content1 .right h4:last-of-type {
/* background: #000; */
position: absolute;
top: 10px;
right: 10%;
}
.content1 .right .rightImg {
height: 60px;
/* border: 1px solid #000; */
line-height: 60px;
}
.content1 .right .rightImg img {
width: 40px;
margin-left: 5px;
vertical-align: middle;
}
.content1 .right .rightFont {
margin: 8px 5px;
width: 100%;
}
.content1 .right .rightFont a {
margin: 2px;
color: #333;
}
.content1 .right .rightFont a:hover {
color: #777;
}
.content1 .main {
background: rgba(255, 255, 255, 1);
box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.05);
border-radius: 0.8em;
margin: 0 10px;
padding: 10px;
/* position: relative; */
max-width: 620px;
}
.content1 .main span {
background: #93999f;
padding: 2px;
color: #fff;
font-size: 0.8em;
margin: 0 5px;
}
.content1 .main ul li {
/* margin: 10px 10px; */
margin: 20px auto;
/* height: 200px; */
/* background: #777; */
}
.content1 .main ul li div {
background: rgba(255, 255, 255, 1);
box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.1);
border-radius: 0.7em;
padding: 5px;
/* margin: 15px; */
width: 180px;
height: 70px;
position: relative;
top: 10px;
left: 0;
/* border: 5px solid red; */
}
.content1 .main ul li a {
color: #333;
}
.content1 .main ul li a:hover {
color: #777;
}
.content1 .main ul li div img {
border-radius: 0.8em;
width: 180px;
position: relative;
top: -10px;
left: -5px;
}
/* content2 */
.content2 .content_ad_down {
width: 360px;
/* border: 1px solid red; */
margin: 20px 0;
}
.content2 .content_ad_down .content_ad {
height: 187px;
border-radius: 0.7em;
background: rgba(255, 255, 255, 1);
margin-bottom: 10px;
padding: 1px;
}
.content2 .content_ad_down .content_ad img {
width: 356px;
height: 183px;
border-radius: 0.7em;
}
.content2 .content_ad_down .content_ad a {
display: block;
position: relative;
top: -33px;
left: 0;
background: rgb(0, 0, 0, 0.7);
color: #fff;
width: 300px;
height: 30px;
line-height: 30px;
padding-left: 10px;
}
.content2 .content_ad_down .content_ad span {
display: inline-block;
position: relative;
top: -53px;
left: 305px;
background: rgb(0, 0, 0, 0.7);
color: #fff;
margin: 0 1px;
width: 8px;
height: 10px;
line-height: 30px;
padding-left: 10px;
}
.content2 .content_ad_down .content_down {
background: rgb(255, 255, 255, 1);
border-radius: 0.7em;
position: relative;
/* border: 1px solid red; */
}
.content2 .content_ad_down .content_down .down_title {
font-weight: bold;
height: 33px;
line-height: 33px;
border-bottom: 2px solid rgb(255, 74, 0);
padding-left: 10px;
}
.content2 .content_ad_down .content_down .down_title span {
position: absolute;
top: 0;
right: 8px;
}
.content2 .content_ad_down .content_down .down_title span a {
color: #333;
font-weight: normal;
}
.content2 .content_ad_down .content_down .down_title span a:hover {
color: #777;
}
.content2 .content_ad_down .content_down .down_content {
/* margin-top: 10px;
margin-left: 20px; */
min-height: 260px;
}
.content2 .content_ad_down .content_down .down_content ul li {
list-style: outside;
margin: 10px 20px;
color: #ccc;
}
.content2 .content_ad_down .content_down .down_content span {
/* color: #333; */
position: absolute;
/* top: 10px; */
right: 10px;
}
.content2 .content_ad_down .content_down .down_content a {
color: #333;
}
.content2 .content_ad_down .content_down .down_content a:hover {
color: #777;
}
.content2 .content_arc {
/* border: 1px solid #000; */
width: 510px;
margin: 20px 0;
border-radius: 0.7em;
background: rgba(255, 255, 255, 1);
}
.content2 .content_arc .arc_title {
border-bottom: 1px solid #eaeaea;
height: 35px;
line-height: 35px;
}
.content2 .content_arc .arc_title span {
display: inline-block;
height: 35px;
margin-left: 15px;
cursor: pointer;
color: #333;
}
.content2 .content_arc .arc_title span:first-of-type {
border-bottom: 1px solid #f80303;
}
.content2 .content_arc .arc_content ul li {
margin: 7px 10px;
position: relative;
}
.content2 .content_arc .arc_content ul li span:first-of-type {
display: inline-block;
width: 75px;
/* border: 1px solid red; */
text-align: right;
}
.content2 .content_arc .arc_content ul li span {
margin: 0 3px;
color: #999;
}
.content2 .content_arc .arc_content ul li span:last-of-type {
display: inline-block;
position: absolute;
top: 3px;
right: 5px;
color: #f20b0b;
}
.content2 .content_arc .arc_content ul li a {
margin-left: 2px;
color: #333;
}
.content2 .content_arc .arc_content ul li a:hover {
color: #777;
}
.content2 .content_qa {
width: 310px;
margin: 20px 0;
/* border: 1px solid #000; */
border-radius: 0.7em;
background: rgba(255, 255, 255, 1);
}
.content2 .content_qa .qa_title {
border-bottom: 1px solid #eaeaea;
height: 35px;
line-height: 35px;
}
.content2 .content_qa .qa_title span {
margin-left: 15px;
color: #333;
}
.content2 .content_qa .qa_content ul li {
margin: 10px 20px;
}
.content2 .content_qa .qa_content ul li a {
color: #333;
}
.content2 .content_qa .qa_content ul li a:hover {
color: #777;
}
/* .search-related {
border: 1px solid #000;
} */
.search-related .related_type {
width: 230px;
height: 390px;
/* border: 1px solid lightsalmon; */
}
.search-related .related_type .type_title {
height: 40px;
line-height: 40px;
padding-left: 10px;
font-weight: bold;
color: #666;
background: #eee;
font-size: 12px;
border-right: 1px solid #fff;
}
.search-related .related_type .type_content {
/* display: block; */
height: 320px;
background: #515773;
border-right: 1px solid #fff;
border-bottom-left-radius: 8px;
}
.search-related .related_type .type_content ul li {
padding: 12px 0 0px 20px;
}
.search-related .related_type .type_content ul li a {
color: #fff;
font-size: 14px;
}
.search-related .related_type .type_content ul li a span {
color: #bbbbbb;
font-size: 12px;
padding-left: 5px;
}
/* ------------------------- */
.search-related .related_search {
width: 970px;
height: 390px;
/* margin-bottom: 20px; */
/* border: 1px solid lightseagreen; */
}
.search-related .related_search .search_title {
height: 40px;
line-height: 40px;
padding-left: 10px;
font-weight: bold;
color: #666;
background: #eee;
font-size: 12px;
}
.search-related .related_search .search_title a {
margin-right: 20px;
padding-bottom: 10px;
display: block;
height: 40px;
line-height: 40px;
padding: 0 10px;
font-size: 12px;
font-weight: bold;
color: #666;
}
.search-related .related_search .search_title a:first-of-type {
color: #fff;
background: #515773;
}
.search-related .related_search .search_content {
height: 320px;
background: #515773;
padding: 30px;
border-bottom-right-radius: 8px;
}
.search-related .related_search .search_content .sc_title {
font-size: 2em;
font-weight: bold;
color: #e4e0e0;
margin: 10px auto;
}
.search-related .related_search .search_content .sc_title2 {
margin: 5px auto;
color: #fff;
}
.search-related .related_search .search_content .search_div {
width: 80%;
height: 50px;
line-height: 50px;
margin: 20px auto;
color: #fff;
/* border: 1px solid #000; */
background: #fff;
position: relative;
}
.search-related .related_search .search_content .search_div span:first-of-type {
display: inline-block;
width: 50px;
height: 50px;
color: #333;
text-align: center;
}
.search-related .related_search .search_content .search_div input {
border-style: none;
width: 80%;
height: 48px;
}
.search-related .related_search .search_content .search_div button {
display: block;
border-style: none;
background: none;
height: 50px;
line-height: 50px;
color: #fff;
margin: 0 auto;
}
.search-related .related_search .search_content .search_div span:last-of-type {
position: absolute;
right: 0;
width: 100px;
height: 50px;
background: #98a1ad;
}
.search-related .related_search .search_content .hot_key {
margin-bottom: 25px;
color: #fff;
}
.search-related .related_search .search_content .hot_key span {
display: inline-block;
color: #fff;
background: #898c87;
font-size: 12px;
text-align: center;
border-radius: 8px;
height: 35px;
line-height: 35px;
padding: 0 5px;
margin: 10px;
}
.search-related .related_search .search_content .ls_key {
margin-top: -20px;
color: #fff;
}
.content3 {
background: #fff;
/* border-radius: 8px; */
height: 635px;
}
.content3 .content3_title {
text-align: center;
font-size: 20px;
font-weight: 600;
color: #4d555d;
line-height: 30px;
padding-top: 20px;
padding-bottom: 10px;
}
.content3 .content3_content {
/* border: 1px solid #000; */
padding: 10px;
}
.content3 .content3_content .content_left ul li {
position: relative;
}
.content3 .content3_content .content_left .ct3_left_ad img {
width: 217px;
height: 364px;
border-radius: 8px;
margin-bottom: 18px;
}
.content3 .content3_content .content_left ul li img {
width: 217px;
height: 124px;
border-radius: 8px;
border: none;
}
.content3 .content3_content .content_left ul li span {
position: absolute;
top: 124px;
left: 0;
/* bottom: -50px; */
width: 217px;
height: 42px;
background-color: #fff;
color: #93999f;
font-size: 12px;
line-height: 42px;
padding: 0 20px;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.1);
}
.content3 .content3_content .content_left ul li a {
display: block;
border-radius: 8px;
padding: 15px 20px;
position: absolute;
top: 86px;
transition: top 0.3s;
height: 80px;
width: 217px;
background: #e2e2e2;
color: #555;
}
.content3 .content3_content .content_left ul li a:hover {
color: #333;
top: 45px;
}
/* 点击次数
.content3 .content3_content .content_left ul li span {
position: absolute;
bottom: -36px;
width: 100%;
height: 42px;
background-color: #fff;
color: #93999f;
font-size: 12px;
line-height: 42px;
padding: 0 20px;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.1);
}
.content3 .content3_content .content_left ul li a {
display: block;
border-radius: 8px;
padding: 15px 20px;
position: absolute;
top: 83px;
transition: top 0.3s;
height: 80px;
width: 100%;
background: #e2e2e2;
color: #555;
}
.content3 .content3_content .content_left ul li a:hover {
color: #333;
top: 46px;
} */
.content3 .content3_content .content_right {
width: 100%;
/* border: 1px solid yellowgreen; */
margin-left: 20px;
}
/* 右---------------------------------------- */
.content3 .content3_content .content_right ul li {
position: relative;
/* margin: 30px 5px; */
height: 192px;
}
.content3 .content3_content .content_right ul li img {
width: 217px;
height: 124px;
border-radius: 8px;
border: none;
}
.content3 .content3_content .content_right ul li span {
position: absolute;
top: 124px;
left: 0;
/* bottom: -50px; */
width: 217px;
height: 42px;
background-color: #fff;
color: #93999f;
font-size: 12px;
line-height: 42px;
padding: 0 20px;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
box-shadow: 0 4px 8px 0 rgba(7, 17, 27, 0.1);
}
.content3 .content3_content .content_right ul li a {
display: block;
border-radius: 8px;
padding: 15px 20px;
position: absolute;
top: 86px;
transition: top 0.3s;
height: 80px;
width: 217px;
background: #e2e2e2;
color: #555;
}
.content3 .content3_content .content_right ul li a:hover {
color: #333;
top: 50px;
}
.footer {
padding: 20px;
background: #393d49;
color: #787d82;
}
.footer .footer_left .footer_link a {
margin: 0 10px;
color: #c8cdd2;
}
.footer .footer_left .footer_link a:hover {
color: #fff;
}
.footer .footer_left .footer_company span {
/* font-size: 11px; */
}
.footer .footer_left .footer_company img {
padding-top: 25px;
width: 50px;
}
.footer .footer_left .copyright img {
padding-top: 25px;
width: 15px;
}
.footer .footer_left .copyright a {
margin: 0 1px;
color: #787d82;
}
.footer .footer_left .copyright a:hover {
color: #fff;
}
.footer .footer_left .add_tel {
padding-top: 25px;
}
.footer .footer_left .code{
position: relative;
}
.footer .footer_left .code img:last-of-type {
margin: 3px;
width: 100px;
position: absolute;
top: -150px;
right: 2%;
}
.footer .footer_left .code img:first-of-type {
margin: 3px;
width: 100px;
position: absolute;
top: -150px;
right: 12%;
}
CSS样式:通用部分
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
overflow-y: auto;
font: 14px Helvetica Neue,Helvetica,PingFang SC,微软雅黑,Tahoma,Arial,sans-serif;
background: #F3F5F7;
}
li,dd{
list-style: none;
}
a{
text-decoration: none;
}
button,img{
border: none;
outline: none;
}
/* 过渡动画: */
.navTs{
transition:all 200ms ease;
}
.container {
width: 1200px;
margin: 0 auto;
}
/* 转为flex容器 */
.flexDis {
display: flex;
}
/* flex项目收缩比例:不收缩 */
.flexShrinkStatic {
flex-shrink: 0;
}
/* flex项目收缩比例:等比收缩 */
.flexShrinkAuto {
flex-shrink: 1;
}
/* flex项目放大比例: */
.flexGrowAuto {
flex-grow: 1;
}
/* flex主轴排列:水平排列 */
.flexDir-x {
flex-direction: row;
}
/* flex主轴排列:垂直排列 */
.flexDir-y {
flex-direction: column;
}
/* flex主轴换行:换行 */
.flexWrap {
flex-wrap: wrap;
}
/* flex主轴换行:不换行 */
.flexNoWrap {
flex-wrap: nowrap;
}
/* 主轴水平对齐方式-------------------------------------- */
/* flex主轴对齐方式:左对齐 */
.flexContentS {
justify-content: start;
}
/* flex主轴对齐方式:右对齐 */
.flexContentE {
justify-content: end;
}
/* flex主轴对齐方式:中对齐 */
.flexContentC {
justify-content: center;
}
/* flex主轴对齐方式:均匀排列每个元素,每个元素之间的间隔相等 */
.flexContentV {
justify-content: space-evenly;
}
/* flex主轴对齐方式:均匀排列每个元素,首个元素放置于起点末尾元素放置于终点 */
.flexContentB {
justify-content: space-between;
}
/* flex主轴对齐方式:均匀排列每个元素,元素之前、之间、之后都留有空白的容器内。 */
.flexContentA {
justify-content: space-around;
}
/* 主轴垂直对齐方式-------------------------------------- */
/* 行内上对齐-定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 */
.flexAlignS {
align-items: start;
}
/* 行内中对齐-定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 */
.flexAlignC {
align-items: center;
}
/* 行内下对齐-定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 */
.flexAlignE {
align-items: end;
}
/* 元素位于容器的基线上。-定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 */
.flexAlignB {
align-items: baseline;
}
/* 默认值。元素被拉伸以适应容器。-定义flex子项在flex容器的当前行的侧轴(纵轴)方向上的对齐方式。 */
.flexAlignT {
align-items: stretch;
}
总结:
通过学习Flex布局,能基本模仿出基本样式,弹性盒子的优点是自适应,这里使用的基本为像素单位,有些还未定义尺寸,由内容撑开,当图片确失或未加载,会导致布局错乱,需要在后期学习中不断改进。