[css flex布局]实例一,本来还想挺简单的,弄了挺久呢,先写一部分
全是代码,直接拷走吧,看是不怎么好看的
参考:http://www.ruanyifeng.com/blog/search.html?cx=016304377626642577906%3Ab_e9skaywzq&cof=FORID%3A11&ie=UTF-8&q=flex&sa.x=0&sa.y=0
作者:阮一峰
CSS
<style>
p{height:15px}
.box{margin:20px;width:80px;height:80px;box-shadow:5px 5px #;
border:1px solid black;border-radius:10px;}
span{margin:5px;width:16px;height:16px;border-radius:%;background:black} .box1 div{float:left}
.clear:after{content:'';clear:both;display:block}
/**/
.box11{display:flex}
.box12{display:flex;justify-content:center}
.box13{display:flex;justify-content:flex-end}
.box14{display:flex;align-items:center}
.box15{display:flex;justify-content:center;align-items:center}
.box16{display:flex;justify-content:flex-end;align-items:center}
.box17{display:flex;align-items:flex-end;}
.box18{display:flex;justify-content:center;align-items:flex-end;}
.box19{display:flex;justify-content:flex-end;align-items:flex-end;}
/**/
.box21{display:flex;justify-content:space-between}
.box22{display:flex;justify-content:space-between;align-items:center}
.box23{display:flex;justify-content:space-between;align-items:flex-end;}
.box24{display:flex;justify-content:space-between;flex-direction:column}
.box25{display:flex;justify-content:space-between;flex-direction:column;align-items:center}
.box26{display:flex;justify-content:space-between;flex-direction:column;align-items:flex-end}
.box27{display:flex;justify-content:space-between;}
.box27>.item:nth-child(){align-self:flex-end}
.box28{display:flex;}
.box28>.item:nth-child(){align-self:center}
/**/
.box31{display:flex}
.box32{display:flex;align-items:center}
.box33{display:flex;align-items:flex-end}
.box34{display:flex;flex-direction:column}
.box35{display:flex;flex-direction:column;align-items:center}
.box36{display:flex;flex-direction:column;align-items:flex-end}
/*3.1*/
.box311{display:flex}
.box311 .item:nth-child(){align-self:center}
.box312{display:flex}
.box312 .item:nth-child(){align-self:flex-end}
.box313{display:flex;align-items:center}
.box313 .item:nth-child(){align-self:flex-start}
.box314{display:flex;align-items:center}
.box314 .item:nth-child(){align-self:flex-end}
.box315{display:flex;align-items:flex-end}
.box315 .item:nth-child(){align-self:center}
.box316{display:flex;align-items:flex-end}
.box316 .item:nth-child(){align-self:flex-start}
/*3.1*/
.box321{display:flex;flex-direction:column}
.box321 .item:nth-child(){align-self:center}
.box322{display:flex;flex-direction:column}
.box322 .item:nth-child(){align-self:flex-end}
.box323{display:flex;flex-direction:column;align-items:center}
.box323 .item:nth-child(){align-self:flex-start}
.box324{display:flex;flex-direction:column;align-items:center}
.box324 .item:nth-child(){align-self:flex-end}
.box325{display:flex;flex-direction:column;align-items:flex-end}
.box325 .item:nth-child(){align-self:flex-start}
.box326{display:flex;flex-direction:column;align-items:flex-end}
.box326 .item:nth-child(){align-self:center}
/*4-5-6-9*/
.box41{display:flex;flex-wrap:wrap;align-content:space-between}
.box41 .column{flex-basis:%;display:flex;justify-content:space-between}
.box42{display:flex;flex-wrap:wrap;align-content:space-between}
.box43{display:flex;flex-wrap:wrap;align-content:space-between;flex-direction:row-reverse}
.box44{display:flex;flex-wrap:wrap;}
.box44 .row{flex-basis:%;display:flex;justify-content:space-between}
.box44 .row:nth-child(){justify-content:center}
/*.box44 .row:nth-child(3){display:flex;justify-content:space-between}*/
.box45{display:flex;flex-wrap:wrap;align-content:space-between}
.box46{display:flex;flex-direction:column;flex-wrap:wrap;align-content:space-between}
.box47{display: flex;flex-wrap: wrap}
</style>
HTML
<div class="box1">
<p>单项目</p>
<div class="box box11"><span class="item"></span></div>
<div class="box box12"><span class="item"></span></div>
<div class="box box13"><span class="item"></span></div>
<div class="box box14"><span class="item"></span></div>
<div class="box box15"><span class="item"></span></div>
<div class="box box16"><span class="item"></span></div>
<div class="box box17"><span class="item"></span></div>
<div class="box box18"><span class="item"></span></div>
<div class="box box19"><span class="item"></span></div>
</div>
<div class="clear"></div>
<div class="box1">
<p>双项目</p>
<div class="box box21"><span class="item"></span><span class="item"></span></div>
<div class="box box22"><span class="item"></span><span class="item"></span></div>
<div class="box box23"><span class="item"></span><span class="item"></span></div>
<div class="box box24"><span class="item"></span><span class="item"></span></div>
<div class="box box25"><span class="item"></span><span class="item"></span></div>
<div class="box box26"><span class="item"></span><span class="item"></span></div>
<div class="box box27"><span class="item"></span><span class="item"></span></div>
<div class="box box28"><span class="item"></span><span class="item"></span></div>
</div>
<div class="clear"></div>
<div class="box1">
<p>3项目</p>
<div class="box box31"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box32"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box33"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box34"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box35"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box36"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
</div>
<div class="clear"></div>
<div class="box1">
<p>3.1</p>
<div class="box box311"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box312"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box313"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box314"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box315"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box316"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
</div>
<div class="clear"></div>
<div class="box1">
<p>3.2</p>
<div class="box box321"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box322"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box323"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box324"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box325"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
<div class="box box326"><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
</div>
<div class="clear"></div>
<div class="box1">
<p>---</p>
<div class="box box41">
<div class="column"><span class="item"></span><span class="item"></span></div>
<div class="column"><span class="item"></span><span class="item"></span></div>
</div>
<div class="box box42"><span class="item"></span><span class="item"></span><span class="item"></span><span class="item"></span></div>
<div class="box box43"><span class="item"></span><span class="item"></span><span class="item"></span><span class="item"></span></div>
<div class="box box44">
<div class="row"><span class="item"></span><span class="item"></span></div>
<div class="row"><span class="item"></span></div>
<div class="row"><span class="item"></span><span class="item"></span></div>
</div>
<div class="box box45">
<span class="item"></span><span class="item"></span><span class="item"></span>
<span class="item"></span><span class="item"></span><span class="item"></span>
</div>
<div class="box box46">
<span class="item"></span><span class="item"></span><span class="item"></span>
<span class="item"></span><span class="item"></span><span class="item"></span>
</div>
<div class="box box47"><span class="item"></span><span class="item"></span><span class="item"></span><span class="item"></span><span class="item"></span><span class="item"></span><span class="item"></span><span class="item"></span></span><span class="item"></span></div>
</div>
[css flex布局]实例一,本来还想挺简单的,弄了挺久呢,先写一部分的更多相关文章
- 轻轻松松学CSS:Flex布局
Flex布局就是"弹性布局",它可以简便.完整.响应式地实现各种页面布局.引入弹性布局的目的,当页面需要适应不同的屏幕大小确保元素拥有恰当的布局方式,对一个容器中的子元素进行排列 ...
- CSS Flex布局完全指南 #flight.Archives002
Title/CSS Flex布局完全指南 #flight.Archives002 序(from Ruanyf) : 网页布局(layout)是 CSS 的一个重点应用. 布局的传统解决方案,基于盒状模 ...
- [Web 前端 ] 还在用浮动吗?CSS flex布局你了解多少?
cp from : https://blog.csdn.net/wwwxuewen/article/details/80859764 传统的布局:围绕盒子模型(border.margin.paddin ...
- CSS flex 布局快速入门
以前已经学过flex了,一直没做笔记,现在做下笔记再回忆下. 首先,flex布局的迷之属性们,如果一知半解,机械记忆的话,那不到半个月基本忘光光.先感受一下这12个flex布局属性,是不是很“迷”人. ...
- CSS flex 布局学习笔记
写在前面 Flex 是 Flexible Box 的缩写,意为"弹性布局",用来为盒状模型提供最大的灵活性. 任何一个容器都可以指定为 Flex 布局. 采用 Flex 布局的元素 ...
- css flex布局
关于flex布局的一些简单用法 效果(下图) 实现代码: <!--html--> <div class="wrap"> <div class=&quo ...
- flex布局实例demo全解
上篇文章介绍了Flex布局的语法,今天介绍常见布局的Flex写法. 你会看到,不管是什么布局,Flex往往都可以几行命令搞定. 我只列出代码,详细的语法解释请查阅<Flex布局教程:语法篇> ...
- css flex布局详解
来源:https://blog.csdn.net/liveinmylife/article/details/51838939 1,flex布局是个什么东西? 官方说法:Flex是Flexible Bo ...
- CSS Flex布局整理
Flex布局 display: flex; 将对象作为弹性伸缩盒展示,用于块级元素 display: inline-flex; 将对象作为弹性伸缩盒展示,用于行内元素 注意兼容问题: webkit内核 ...
随机推荐
- iNeuOS 工业互联网 从网关到云端一体化解决方案。教你如何做PPT。
iNeuOS 专注打造云端操作系统,提供全新解决方案 (凑够150字) 核心组件包括:边缘网关(iNeuLink).设备容器(iNeuKernel).视图建模(iNeuView).机器 ...
- [ch05-02] 用神经网络解决多变量线性回归问题
系列博客,原文在笔者所维护的github上:https://aka.ms/beginnerAI, 点击star加星不要吝啬,星越多笔者越努力 5.2 神经网络解法 与单特征值的线性回归问题类似,多变量 ...
- PlantUML Viewer Chrome 插件 画时序图
PlantUML通过简单直观的语言来定义示意图 使用 Chrome+ PlantUML Viewer的插件画图 1,打开chrome网上应用店 2,搜索plantuml viewer 并添加 3,扩展 ...
- ARTS-S k8s常用命令
本地访问minikube的docker eval $(minikube docker-env) 删除statefulset kubectl delete statefulset web --casca ...
- vbs 脚本 获取机器名/IP/MAC
strComputer = "."strMesseage="" Set objWMIService = GetObject("winmgmts:{im ...
- Python3 网络编程小练习
三次握手.四次挥手图示意图 基于TCP开发一款远程cmd程序 # server.py import socket import subprocess server = socket.socket() ...
- Python3、setuptools、Pip3安装详解
Python3.setuptools.Pip3安装详解 2017年08月19日 18:58:47 安静的技术控 阅读数:26002 版权声明:本文为博主原创文章,未经博主允许不得转载. http ...
- Django forms组件与钩子函数
目录 一.多对多的三种创建方式 1. 全自动 2. 纯手撸(了解) 3. 半自动(强烈推荐) 二.forms组件 1. 如何使用forms组件 2. 使用forms组件校验数据 3. 使用forms组 ...
- java基础集合简介Set(三)中
今天主要说夏set集合,每天抽出一个小时总结下,生活会更加美好! --< java.util >-- Set接口: 数据结构:数据的存储方式: Set接口中的方法和Collection中方 ...
- before和after的操作
before和after,前者是在元素之前插入东西,后者是在元素后面插入东西,但插入的东西不仅仅只是文字而已,还有图标,以及计算器的操作. 由于两者的操作基本一样,这里以before为例 插入文字 & ...