热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

11月7日作业:1.将php中文网移动端剩余部分的内容写完实例*页面初始化样式*body,footer{min-width:768px;max-width:320px;margin

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的一些属性记不住,今后我会多写,多看,多记的。



推荐阅读
  • 本文介绍了使用Java实现大数乘法的分治算法,包括输入数据的处理、普通大数乘法的结果和Karatsuba大数乘法的结果。通过改变long类型可以适应不同范围的大数乘法计算。 ... [详细]
  • 本文介绍了lua语言中闭包的特性及其在模式匹配、日期处理、编译和模块化等方面的应用。lua中的闭包是严格遵循词法定界的第一类值,函数可以作为变量自由传递,也可以作为参数传递给其他函数。这些特性使得lua语言具有极大的灵活性,为程序开发带来了便利。 ... [详细]
  • 本文介绍了C#中数据集DataSet对象的使用及相关方法详解,包括DataSet对象的概述、与数据关系对象的互联、Rows集合和Columns集合的组成,以及DataSet对象常用的方法之一——Merge方法的使用。通过本文的阅读,读者可以了解到DataSet对象在C#中的重要性和使用方法。 ... [详细]
  • 知识图谱——机器大脑中的知识库
    本文介绍了知识图谱在机器大脑中的应用,以及搜索引擎在知识图谱方面的发展。以谷歌知识图谱为例,说明了知识图谱的智能化特点。通过搜索引擎用户可以获取更加智能化的答案,如搜索关键词"Marie Curie",会得到居里夫人的详细信息以及与之相关的历史人物。知识图谱的出现引起了搜索引擎行业的变革,不仅美国的微软必应,中国的百度、搜狗等搜索引擎公司也纷纷推出了自己的知识图谱。 ... [详细]
  • 1,关于死锁的理解死锁,我们可以简单的理解为是两个线程同时使用同一资源,两个线程又得不到相应的资源而造成永无相互等待的情况。 2,模拟死锁背景介绍:我们创建一个朋友 ... [详细]
  • 动态规划算法的基本步骤及最长递增子序列问题详解
    本文详细介绍了动态规划算法的基本步骤,包括划分阶段、选择状态、决策和状态转移方程,并以最长递增子序列问题为例进行了详细解析。动态规划算法的有效性依赖于问题本身所具有的最优子结构性质和子问题重叠性质。通过将子问题的解保存在一个表中,在以后尽可能多地利用这些子问题的解,从而提高算法的效率。 ... [详细]
  • 本文介绍了指针的概念以及在函数调用时使用指针作为参数的情况。指针存放的是变量的地址,通过指针可以修改指针所指的变量的值。然而,如果想要修改指针的指向,就需要使用指针的引用。文章还通过一个简单的示例代码解释了指针的引用的使用方法,并思考了在修改指针的指向后,取指针的输出结果。 ... [详细]
  • 本文讨论了Alink回归预测的不完善问题,指出目前主要针对Python做案例,对其他语言支持不足。同时介绍了pom.xml文件的基本结构和使用方法,以及Maven的相关知识。最后,对Alink回归预测的未来发展提出了期待。 ... [详细]
  • 本文讲述了作者通过点火测试男友的性格和承受能力,以考验婚姻问题。作者故意不安慰男友并再次点火,观察他的反应。这个行为是善意的玩人,旨在了解男友的性格和避免婚姻问题。 ... [详细]
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • Voicewo在线语音识别转换jQuery插件的特点和示例
    本文介绍了一款名为Voicewo的在线语音识别转换jQuery插件,该插件具有快速、架构、风格、扩展和兼容等特点,适合在互联网应用中使用。同时还提供了一个快速示例供开发人员参考。 ... [详细]
  • 后台获取视图对应的字符串
    1.帮助类后台获取视图对应的字符串publicclassViewHelper{将View输出为字符串(注:不会执行对应的ac ... [详细]
  • 《数据结构》学习笔记3——串匹配算法性能评估
    本文主要讨论串匹配算法的性能评估,包括模式匹配、字符种类数量、算法复杂度等内容。通过借助C++中的头文件和库,可以实现对串的匹配操作。其中蛮力算法的复杂度为O(m*n),通过随机取出长度为m的子串作为模式P,在文本T中进行匹配,统计平均复杂度。对于成功和失败的匹配分别进行测试,分析其平均复杂度。详情请参考相关学习资源。 ... [详细]
  • Java验证码——kaptcha的使用配置及样式
    本文介绍了如何使用kaptcha库来实现Java验证码的配置和样式设置,包括pom.xml的依赖配置和web.xml中servlet的配置。 ... [详细]
  • 高质量SQL书写的30条建议
    本文提供了30条关于优化SQL的建议,包括避免使用select *,使用具体字段,以及使用limit 1等。这些建议是基于实际开发经验总结出来的,旨在帮助读者优化SQL查询。 ... [详细]
author-avatar
甜甜M雪糕
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有