收集网上的flex与php相关视频的代码,媒体查询简介与Flex实战-2019年11月8日

11月7日作业:

1. 将php中文网移动端剩余部分的内容写完

实例

/*页面初始化样式*/

body,

footer {

min-width: 768px;

max-width: 320px;

margin: 0 auto;

background: #edeff0;

/*设置滚动条左边滚动初始化*/

overflow-y: initial;

/*防止以后使用定位属性,将该元素设置为父级元素*/

position: relative;

color: gray;

/*隐藏手机端的水平滚动条*/

overflow-x: hidden;

/*点击链接时出现高亮,设置设置为透明,主要针对苹果手机*/

--webkit-tap-highlight-color: transparent;

}

img {

/*设置图片为自适应显示*/

width: 100%;

}

ul,

li {

margin: 0px;

padding: 0px;

}

li {

/*\去除列表前的小黑点*/

list-style: none;

}

a {

/*去掉下划线*/

text-decoration: none;

color: gray;

}

/*导航样式*/

/*头部样式*/

header {

/*固定定位*/

position: fixed;

top: 0px;

/*固定定位元素必须设置宽度与高度*/

width: 100%;

height: 42px;

background-color: #444444;

color: white;

/*设置最小尺寸*/

min-width: 320px;

max-width: 768px;

/*转为Flex容器,设置元素排列*/

display: flex;

/*元素主轴分散,两端对齐*/

justify-content: space-between;

/*元素交叉轴居中对齐*/

align-items: center;

}

/*第一张,最后一设置通用样式*/

header > img:first-of-type,

header > img:last-of-type {

width: 26px;

height: 26px;

margin: 5px;

}

/*设置中间LOGO样式*/

header > img {

width: 94px;

}

/*设置头像为正圆*/

header > img:first-of-type {

border-radius: 50%;

}

/*************** 轮播图设置 ***************/

.banner {

display: flex;

height: 200px;

}

/*************** 导航区 ***************/

nav {

background: #fff;

/*设置导航块为弹性盒子*/

display: flex;

/*主轴为垂直方向,且不换行*/

flex-flow: column nowrap;

}

/*设置图片大小*/

nav img {

width: 45px;

height: 49px;

}

nav > ul {

/*设置每个ul为弹性盒子*/

display: flex;

/*每个菜单项水平且不换行,可以不写,也是默认值*/

flex-flow: row nowrap;

}

/*每一菜单项均分全部空间*/

nav ul li {

flex: 1;

}

/*图片与文本应该做为一个组件,统一设置*/

nav ul li a {

/*设置每个a标签为弹性盒子*/

display: flex;

/*设置图片垂直排列*/

flex-flow: column wrap;

/*交叉轴上居中显示*/

align-items: center;

/*外边距可以使菜单项之间不太拥挤*/

margin: 10px;

}

/*************** 主体内容区 ***************/

/* 推荐课程区*/

main {

height: 100%;

display: flex;

flex-flow: column nowrap;

}

/*课程水平排列*/

main > .recommend > section:first-of-type {

display: flex;

/*可省了,因为是默认值*/

flex-flow: row nowrap;

}

/*每个课程图片平分全部空间*/

main > .recommend > section:first-of-type > a {

margin: 5px;

flex: 1;

}

/*设置图片高度*/

main > .recommend > section:first-of-type > a > img {

height: 90px;

}

/*课程垂直排列*/

main > .recommend > section:last-of-type {

display: flex;

flex-flow: column nowrap;

}

/*设置垂直排列课程背景颜色*/

main > .recommend > section:last-of-type > div {

background: #fff;

margin: 5px;

/*设置为弹性盒子*/

display: flex;

/*默认值*/

flex-flow: row nowrap;

}

/*设置垂直排列图片高度*/

main > .recommend > section:last-of-type > div img {

width: 350px;

height: 90px;

}

main > .recommend > section:last-of-type > div > span {

/*background: red;*/

display: flex;

flex-flow: column nowrap;

margin-top: 5px;

padding-left: 10px;

}

main > .recommend > section:last-of-type > div > span i {

font-style: normal;

background: #333333;

color: white;

border-radius: 6px;

padding: 0 5px;

font-style: smaller;

}

/*页脚*/

footer {

position: fixed;

bottom: 0px;

width: 100%;

height: 42px;

height: 50px;

display: flex;

flex-flow: row nowrap;

padding-top: 10px;

border-top: 1px solid #cccccc;

}

footer > a > img {

width: 16px;

height: 16px;

}

footer a {

display: flex;

/*设置图片垂直排列*/

flex-flow: column wrap;

/*交叉轴上居中显示*/

align-items: center;

flex: 1;

}

footer a:first-of-type > img,

footer a:first-of-type > span {

color: red;

}

/*最近更新*/

main > .recent-updates > section > div img {

width: 350px;

height: 90px;

}

main > .recent-updates {

display: flex;

flex-flow: column nowrap;

}

main > .recent-updates > section > div {

/*border:1px solid red;*/

background: #fff;

margin: 10px;

display: flex;

/*交叉轴上空间在元素二侧平均分配,元素间隙比它到边框间隙大一倍*/

align-content: space-around;

}

main > .recent-updates > section > div > span {

display: flex;

flex-flow: column nowrap;

align-content: flex-end;

margin-top: 5px;

padding-left: 10px;

}

main > .recent-updates > section > div > span > span:first-of-type {

margin-top: 5px;

font-size: x-small;

}

main > .recent-updates > section > div > span > span:nth-of-type(2) {

/*border: 1px solid red;*/

margin-top: 5px;

font-size: x-small;

display: flex;

/*主轴上首元素贴起始线,尾元素贴终止线,剩余元素均分空间*/

justify-content: space-between;

}

main > .recent-updates > section > div > span > span > i {

/*font-size: small;*/

background: #333333;

color: white;

border-radius: 6px;

padding: 0 5px;

}

/*最新文章*/

main > .previous-posts {

display: flex;

/*垂直排列且不换行*/

flex-flow: column nowrap;

}

main > .previous-posts > section > div img {

width: 218px;

height: 65px;

}

main > .previous-posts > section > div {

background: #fff;

padding: 10px;

margin: 10px;

display: flex;

/*主轴上首元素贴起始线,尾元素贴终止线,剩余元素均分空间*/

justify-content: space-between;

}

main > .previous-posts > section > div > span {

/*border:1px solid red;*/

display: flex;

flex-flow: column nowrap;

/*主轴上空间在元素二侧平均分配,元素间隙比它到边框间隙大一倍*/

/*justify-content: space-around;*/

}

main > .previous-posts > section > div > span > a:first-of-type {

font-weight: bold;

}

main > .previous-posts > section > div > span > a:last-of-type {

font-size: x-small;

}

main > .previous-posts > section > div:last-of-type {

/*border:1px solid red;*/

color: gray;

justify-content: center;

}

/*最新博文*/

main > .latest-blog {

display: flex;

/*垂直排列且不换行*/

flex-flow: column nowrap;

}

main > .latest-blog > section > div {

/*border:1px solid red;*/

background: #fff;

padding: 10px;

margin: 10px;

}

main > .latest-blog > section > div > span {

display: flex;

justify-content: space-between;

}

main > .latest-blog > section > div > span > a:first-of-type {

/*border:1px solid red;*/

/*字体加粗*/

font-weight: bold;

/*字体大小*/

font-size: small;

}

main > .latest-blog > section > div > span > a:last-of-type {

/*border:1px solid red;*/

/*字体加粗*/

/*font-weight: bold;*/

/*字体大小*/

font-size: xx-small;

}

main > .latest-blog > section > div:last-of-type {

/*border:1px solid red;*/

display: flex;

color: gray;

justify-content: center;

}

/*  最新问答  */

main > .latest-question {

display: flex;

/*垂直排列且不换行*/

flex-flow: column nowrap;

}

main > .latest-question > section > div {

/*border:1px solid red;*/

background: #fff;

padding: 10px;

margin: 10px;

}

main > .latest-question > section > div > span {

display: flex;

justify-content: space-between;

}

main > .latest-question > section > div > span > a:first-of-type {

/*border:1px solid red;*/

/*字体加粗*/

font-weight: bold;

/*字体大小*/

font-size: small;

}

main > .latest-question > section > div > span > a:last-of-type {

/*border:1px solid red;*/

/*字体加粗*/

/*font-weight: bold;*/

/*字体大小*/

font-size: xx-small;

}

main > .latest-question > section > div:last-of-type {

/*border:1px solid red;*/

display: flex;

color: gray;

justify-content: center;

margin-bottom: 70px

}

HTML代码

实例

    

    

    

    

  •                 

    HTML/CSS

  •                 

    JavaScript

  •                 

    服务端

  •                 

    数据库

  •             

    移动端

  •                 

    手册

  •             

    工具

  •                 

    直播

推荐课程

            

            

                    

CI框架30分钟极速入门

中级49738次播放

                    

2018前端入门基础

初级209952次播放

最近更新

                    

2019python自学视频

本课程适合想从零开始学习 Python 编程语言的开发人员。由浅入深的带你

中级49738次播放

                    

PHP开发免费公益直播课

主讲:php中文网-朱老师( Peter Zhu) 时间:2019.10.17 晚 20:00-22:00 主

中级49738次播放

                    

从零开始到WEB响应式布局

重点介绍了HTML、CSS、web布局前端核心技术,通过视频讲解,了解可

初级49738次播放

最新文章

PHP如何去除数组中的空值?(图文+视频)

发布时间:2019-10-09

                    

PHP如何去除数组中的空值?(图文+视频)

发布时间:2019-10-09

                    

PHP如何去除数组中的空值?(图文+视频)

发布时间:2019-10-09

                    

更多内容

最新博文

移动端 、手机端、去掉横向滚动条 亲测生效!!!

发布时间:2019-10-09

PHP学习第一天:软件安装篇

发布时间:2019-10-09

Linux系统CentOS报错:could not resolve host:mirrorlist.centos.org问题

发布时间:2019-10-09

更多内容

最新问答

固定定位后会突破原来的定位父级?

发布时间:2019-10-09

密码规则错误

发布时间:2019-10-09

php可以定位客户端嘛

发布时间:2019-10-09

更多内容

        

首页

        

视频

        

社区

        

我的

效果:

6713d94a004eb53e0f3f86fe94f63989.png

b364ecb41d16088ecf6e1aea87f5ed50.png

2. 将中间导航菜单区的代码手抄至少一遍, 并给每一行代码加上注释

手抄:

62490a3b9163d2faecf098acf51a98ba.png

3. 作业总结

通过该项目实战,让我对flex各种属性的使用能更加得心应手。

还有一些不足的地方,css的一些属性记不住,今后我会多写,多看,多记的。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
资源包主要包含以下内容: ASP项目源码:每个资源包中都包含完整的ASP项目源码,这些源码采用了经典的ASP技术开发,结构清晰、注释详细,帮助用户轻松理解整个项目的逻辑和实现方式。通过这些源码,用户可以学习到ASP的基本语法、服务器端脚本编写方法、数据库操作、用户权限管理等关键技术。 数据库设计文件:为了方便用户更好地理解系统的后台逻辑,每个项目中都附带了完整的数据库设计文件。这些文件通常包括数据库结构图、数据表设计文档,以及示例数据SQL脚本。用户可以通过这些文件快速搭建项目所需的数据库环境,并了解各个数据表之间的关系和作用。 详细的开发文档:每个资源包都附有详细的开发文档,文档内容包括项目背景介绍、功能模块说明、系统流程图、用户界面设计以及关键代码解析等。这些文档为用户提供了深入的学习材料,使得即便是从零开始的开发者也能逐步掌握项目开发的全过程。 项目演示与使用指南:为帮助用户更好地理解和使用这些ASP项目,每个资源包中都包含项目的演示文件和使用指南。演示文件通常以视频或图文形式展示项目的主要功能和操作流程,使用指南则详细说明了如何配置开发环境、部署项目以及常见问题的解决方法。 毕业设计参考:对于正在准备毕业设计的学生来说,这些资源包是绝佳的参考材料。每个项目不仅功能完善、结构清晰,还符合常见的毕业设计要求和标准。通过这些项目,学生可以学习到如何从零开始构建一个完整的Web系统,并积累丰富的项目经验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值