css3伸缩布局中justify-content详解
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>CSS3伸缩布局</title>
- <style>
- body {
- margin: 0;
- padding: 0;
- font-family: '微软雅黑';
- background-color: #F7F7F7;
- }
- ul {
- margin: 0;
- padding: 0;
- list-style: none;
- }
- .wrapper {
- width: 1024px;
- margin: 0 auto;
- }
- .wrapper > section {
- min-height: 300px;
- margin-bottom: 30px;
- box-shadow: 1px 1px 4px #DDD;
- background-color: #FFF;
- }
- .wrapper > header {
- text-align: center;
- line-height: 1;
- padding: 20px;
- margin-bottom: 10px;
- font-size: 30px;
- }
- .wrapper section > header {
- line-height: 1;
- padding: 10px;
- font-size: 22px;
- color: #333;
- background-color: #EEE;
- }
- .wrapper .wrap-box {
- padding: 20px;
- }
- .wrapper .brief {
- min-height: auto;
- }
- .wrapper .flex-img {
- width: 100%;
- }
- /*全局设置*/
- section ul {
- /*把所有ul指定成了伸缩盒子*/
- display: flex;
- /*这里只是一个小的测试*/
- /*flex-direction: row-reverse;*/
- }
- section li {
- width: 200px;
- height: 200px;
- text-align: center;
- line-height: 200px;
- margin: 10px;
- background-color: pink;
- }
- .flex-start ul {
- justify-content: flex-start;
- }
- .flex-end ul {
- justify-content: flex-end;
- }
- .center ul {
- justify-content: center;
- }
- .space-around ul {
- justify-content: space-around;
- }
- .space-between ul {
- justify-content: space-between;
- }
- </style>
- </head>
- <body>
- <div class="wrapper">
- <header>CSS3-伸缩布局详解</header>
- <!-- 简介 -->
- <section class="brief">
- <header>justify-content</header>
- <div class="wrap-box">
- <p>主轴方向对齐,可以调整元素在主轴方向上的对齐方式,包括flex-start、flex-end、center、space-around、space-between几种方式</p>
- </div>
- </section>
- <!-- 分隔线 -->
- <section class="flex-start">
- <header>flex-start</header>
- <div class="wrap-box">
- <p>起始点对齐</p>
- <ul>
- <li>1</li>
- <li>2</li>
- <li>3</li>
- </ul>
- </div>
- </section>
- <section class="flex-end">
- <header>flex-end</header>
- <div class="wrap-box">
- <p>终止点对齐</p>
- <ul>
- <li>1</li>
- <li>2</li>
- <li>3</li>
- </ul>
- </div>
- </section>
- <section class="center">
- <header>center</header>
- <div class="wrap-box">
- <p>居中对齐</p>
- <ul>
- <li>1</li>
- <li>2</li>
- <li>3</li>
- </ul>
- </div>
- </section>
- <section class="space-around">
- <header>space-around</header>
- <div class="wrap-box">
- <p>四周环绕</p>
- <ul>
- <li>1</li>
- <li>2</li>
- <li>3</li>
- </ul>
- </div>
- </section>
- <section class="space-between">
- <header>space-between</header>
- <div class="wrap-box">
- <p>两端对齐</p>
- <ul>
- <li>1</li>
- <li>2</li>
- <li>3</li>
- </ul>
- </div>
- </section>
- </div>
- </body>
- </html>
css3伸缩布局中justify-content详解的更多相关文章
- DIV-CSS布局中position属性详解
本文向大家描述一下DIV CSS布局中的position属性的用法,position属性主要有四种属性值,任何元素的默认position的属性值均是static,静态.这节课主要讲讲relative( ...
- css3自适应布局单位vw,vh详解
视口单位(Viewport units) 什么是视口? 在桌面端,视口指的是在桌面端,指的是浏览器的可视区域:而在移动端,它涉及3个视口:Layout Viewport(布局视口),Visual Vi ...
- css3浏览器私有属性前缀使用详解
什么是浏览器私有属性前缀 CSS3的浏览器私有属性前缀是一个浏览器生产商经常使用的一种方式.它暗示该CSS属性或规则尚未成为W3C标准的一部分. 以下是几种常用前缀 -webkit- -moz- -m ...
- 「翻译」Unity中的AssetBundle详解(二)
为AssetBundles准备资源 使用AssetBundles时,您可以随意将任何Asset分配给所需的任何Bundle.但是,在设置Bundles时,需要考虑一些策略.这些分组策略可以使用到任何你 ...
- 转载 CSS3 经典教程系列:CSS3 盒阴影(box-shadow)详解
目标大纲 文章转载 CSS3 经典教程系列:CSS3 盒阴影(box-shadow)详解 IE中CSS-filter滤镜小知识大全 CSS实现跨浏览器兼容性的盒阴影效果
- Android中Service(服务)详解
http://blog.csdn.net/ryantang03/article/details/7770939 Android中Service(服务)详解 标签: serviceandroidappl ...
- Android中mesure过程详解
我们在编写layout的xml文件时会碰到layout_width和layout_height两个属性,对于这两个属性我们有三种选择:赋值成具体的数值,match_parent或者wrap_conte ...
- Android中Intent组件详解
Intent是不同组件之间相互通讯的纽带,封装了不同组件之间通讯的条件.Intent本身是定义为一个类别(Class),一个Intent对象表达一个目的(Goal)或期望(Expectation),叙 ...
- CSS3 伸缩布局盒模型记
CSS3 伸缩布局盒模型 CSS3引入的布局模式Flexbox布局,主要思想是让容器有能力让其子项目能够改变其宽度,高度,以最佳方式填充可用空间.Flex容器使用Flex项目可以自动放大与收缩,用来填 ...
随机推荐
- APICloud 获取缓存以及清除缓存(常用第三方方法)
一.app中经常会有缓存的清除这个操作,具体如下 1.获取缓存大小 apiready = function() { api.getCacheSize(function(ret, err) { //si ...
- 01 DOS常用命令
有时候没有可视化窗口,命令行对文件进行操作更方便快捷 cmd 命令弹出 dir 查看当前所在目录下的文件 ctrl+c 退出 \a 显示隐藏文件 cd /改变到根目录 dir /a 显示隐藏文件 di ...
- python时间序列按频率生成日期
有时候我们的数据是按某个频率收集的,比如每日.每月.每15分钟,那么我们怎么产生对应频率的索引呢?pandas中的date_range可用于生成指定长度的DatetimeIndex.我们先看一下怎么生 ...
- Scrapy处理200-300范围之外的响应代码
HttpErrorMiddleware 类scrapy.spidermiddlewares.httperror.HttpErrorMiddleware 过滤掉不成功(错误)的HTTP响应,以便蜘蛛不必 ...
- css 陌生属性
记录一些我之前没见过属性 1.width:100vh 100vh 2.min-height:calc(100vh + 51px);cale 3.:nth-child nth-child 和 :n ...
- UNIX C 信号
1.信号处理 #include <signal.h> typedef void(*sighander_t)(int); sighander_t signal(int signum,sigh ...
- JSLinq 的使用
在net 中经常使用Linq 语法或者lamada 表达式,在使用的过程中感觉很方便,但是在涉及到JS的时候,总要自己去写逻辑代码去查询相关数据,通过搜索发现 已经有关于JSLInq的扩展方法,可以像 ...
- 2.1 SVN的安装
一.SVN客户端安装 运行TortoiseSVN-1.6.6.17493-win32-svn-1.6.6.msi程序, 开始安装 点击Next, 下一步 选择 I accept 接受, 点击Next ...
- jquery怎样获取多个复选框的值?
jquery的遍历方法可以获取复选框所欲的选中值 1 2 $("input:checkbox:checked").each(function(index,element)); ...
- (31)Spring Boot导入XML配置【从零开始学Spring Boot】
[来也匆匆,去也匆匆,在此留下您的脚印吧,转发点赞评论: 您的认可是我最大的动力,感谢您的支持] Spring Boot理念就是零配置编程,但是如果绝对需要使用XML的配置,我们建议您仍旧从一个@Co ...