justify-content & align-items & align-content
【justify-content & align-items & align-content】
三个属性均作用于container。
justify-content用于控制main-axis。
align-items用于控制元素在单选中cross-axis中的位置。
align-content用于控制各行在container中cross-axis的位置。
【align-self】
作用于元素,控制元素在单选中cross-axis中的位置。
【示例】
1、自适应导航。
当小于800px时,内容为居中,当小于500px时,内容纵向排列,从上到下。
/* Large */
.navigation {
display: flex;
flex-flow: row wrap;
/* This aligns items to the end line on main-axis */
justify-content: flex-end;
} /* Medium screens */
@media all and (max-width: 800px) {
.navigation {
/* When on medium sized screens, we center it by evenly distributing empty space around items */
justify-content: space-around;
}
} /* Small screens */
@media all and (max-width: 500px) {
.navigation {
/* On small screens, we are no longer using row direction but column */
flex-direction: column;
}
}

http://caibaojian.com/demo/flexbox/flexbox4.html
2、移动优先布局
http://caibaojian.com/demo/flexbox/flexbox5.html
参考:http://caibaojian.com/flexbox-guide.html
justify-content & align-items & align-content的更多相关文章
- iOS开发之AutoLayout中的Content Hugging Priority和 Content Compression Resistance Priority解析
本篇博客的内容也不算太复杂,算是AutoLayout的一些高级的用法.本篇博客我们主要通过一些示例来看一下AutoLayout中的Content Hugging Priority以及Content C ...
- AutoLayout学习之理解intrinsicContentSize,Content Hugging Priority,Content Compression Resistance Priority
TableViewCell的高度计算应该是所有开发者都会使用到的东西,之前都是用代码计算的方法来计算这个高度.最近有时间看了几个计算Cell高度的方法.基本上都用到了AutoLayout,这篇首先介绍 ...
- HTML连载53-网易注册界面实战之content的头部、content注册信息
一. 这次完成了content部分的右边图片以及content的top部分的边角填充 <!DOCTYPE html> <html lang="en"> &l ...
- iOS - FlexBox 布局之 YogaKit
由于刚开始的项目主要用的H5.javaScript技术为主原生开发为辅的手段开发的项目,UI主要是还是H5,如今翻原生.为了方便同时维护两端.才找到这个很不错的库. FlexBox?听起来像是一门H5 ...
- ionic 上拉加载更多&瀑布流加载&滚动到底部加载更多 主意事项
首先下拉刷新的代码是这样的,标红的地方为关键代码 <html> <head> <meta charset="utf-8"> <meta n ...
- 详细分析Orchard的Content、Drivers, Shapes and Placement 类型
本文原文来自:http://skywalkersoftwaredevelopment.net/blog/a-closer-look-at-content-types-drivers-shapes-an ...
- android-SQLite 和 Content
SQLite 游标(Cursor)相当于指向底层数据中结果集的指针,而不是提取和返回结果值的副本,是在结果集中对位置(行)进行控制的管理方式. moveToFirst:把游标移动到查询结果的第一行 m ...
- android学习十二(android的Content Provider(内容提供器)的使用)
文件存储和SharePreference存储以及数据存储一般为了安全,最好用于当前应用程序中訪问和存储数据.内容提供器(Content Provider)主要用于在不同的应用程序之间实现数据共享的功能 ...
- ANDROID content provide 使用实例
Content Provider提供了一种多应用间数据共享的方式,比如:联系人信息可以被多个应用程序访问.Content Provider是个实现了一组用于提供其他应用程序存取数据的标准方法的类. 下 ...
- EXTRACT FILES AND IMAGES FROM A SHAREPOINT CONTENT DATABASE
If you ever had the problem where you need to extract files from a SharePoint Content Database or no ...
随机推荐
- 安装Anaconda3进行python版本管理
1.下载Anaconda3,我选择了python3的64位版本 2.windows安装,选择加入了系统目录 3.进入命令行进行版本安装 // 安装一个指定版本conda create --name p ...
- My sql 自增 虚拟列。
在MYSQL 是没有类似MSSQL 2008 / oracle 数据库开窗函数 over() ,rank(), DENSE_RANK() ,ROW_NUMBER() 又叫窗口函数 . 当我们需要在查询 ...
- java.lang.ClassNotFoundException: org.thymeleaf.spring5.view.ThymeleafViewRe。。。。。。。。。。。
直接上代码问题: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.boot.autoc ...
- spring配置和下载
步骤一:下载 Spring 的开发包: 官网:http://spring.io/ 下 载 地 址 : http://repo.springsource.org/libs-release-local/o ...
- Java URLEncoder URLDecoder
URLDecoder 和 URLEncoder 用于完成普通字符串 和 application/x-www-form-urlencoded MIME 字符串之间的相互转换 URLDecoder类包含一 ...
- python学习笔记_week18
note 1.JS 正则 test - 判断字符串是否符合规定的正则 rep = /\d+/; rep.test("asdfoiklfasdf89asdfasdf") # true ...
- 国内好的python学习地址
python3官方在线文档https://docs.python.org/3/ 玩蛇网http://www.iplaypy.com/ python中文网 http://bbs.pythontab.co ...
- leetcode1014
这道题暴力算法,会超时: class Solution(object): def maxScoreSightseeingPair(self, A: 'List[int]') -> int: n ...
- 利用STM32CubeMX来生成USB_HID_Mouse工程【添加ADC】(1)
现在原来的基础上添加ADC的功能. 现在(利用STM32CubeMX来生成USB_HID_Mouse工程)基础上新增硬件 JoyStick Shield 游戏摇杆扩展板 与STM32F103C8的连接 ...
- react-native Animated, 旋转动画
Animated 仅封装了四个可以动画化的组件: View.Text.Image.ScrollView 可以使用 Animated.createAnimatedComponent()来封装你自己的组件 ...