flex
来源:互联网 发布:js隐藏display 编辑:程序博客网 时间:2024/06/05 05:45
用到flex布局,因为对复合属性的错误使用flex:55;导致在不同商品数下,布局乱掉。
实践的过程中,感觉看似怎么都可以,但需要整体的把握,不能四处尝试,否则效率很低。
以下是demo,实现骰子1~4点,以及垂直布局,中间自适应。比较浅,将继续深入。
<div id="a" class="shazi"> <div class="dian">点</div></div><div id="b" class="shazi"> <div id="b1" class="dian">点</div> <div id="b2" class="dian">点</div></div><div id="c" class="shazi"> <div id="c1" class="dian">点</div> <div id="c2" class="dian">点</div> <div id="c3" class="dian">点</div></div><div id="d" class="shazi"> <div class="row"> <div id="d1" class="dian">点</div> <div id="d2" class="dian">点</div> </div> <div class="row"> <div id="d3" class="dian">点</div> <div id="d4" class="dian">点</div> </div></div><div id="add_msg_site"> <div class="site_add_head"> </div> <section id="J_TabBody" class="body"> </section> <section id="bottom_selections"> </section></div>
.shazi { width: 100 px; height: 100 px; background - color: lightpink;}.dian { width: 20 px; height: 20 px; background - color: #FFF;}#a { display: flex; justify - content: center; align - items: center;}#b { display: flex; justify - content: space - between;}# b1 {}# b2 { align - self: flex - end;}# c { display: flex; //flex-direction:colume-reverse; justify - content: space - around;}# c1 {}# c2 { align - self: center;}# c3 { align - self: flex - end;}# d { display: flex; flex - direction: colume; flex - wrap: wrap; justify - content: space - around; align - content: space - around;}.row { //flex: 1 1 auto; width: 100 %; display: flex; flex - basis: 0 0 100 %; justify - content: space - around;}# add_msg_site { width: 100 %; height: 400 px; display: flex; flex - direction: column; border: 1 px solid red;}.site_add_head { //height: 40px; width: 100 %; margin: 10 px 0; background: yellow; flex: 40 px;}# J_TabBody { width: 100 %; height: auto; flex: 1 1 auto; margin: 0; box - shadow: none!important; margin - bottom: 5 px; background: red;}# bottom_selections { width: 100 %; //height: 135px; flex: 135 px; background: blue;}
0 0
- FLEX
- flex
- flex
- FLEX
- Flex
- Flex
- flex
- Flex
- Flex
- Flex
- Flex
- Flex
- Flex
- Flex
- flex
- Flex
- flex
- flex
- Lua FFI 实战
- Mac和Linux系统的:Arp欺骗源码
- Convet lproj to strings for iOS Android Translation
- altium designer利用向导画封装库详解
- 2.6 代码编写规则
- flex
- ArcGIS API for JS 之创建地图
- JAVA i++ i-- 与 ++i --i的区别
- 获取table中的input=text用户输入的值
- 服务
- Linux系统学习之路
- Android的手势操作识别
- 你的薪水增速跑赢GDP了没
- 使用spring连接及操作mongodb3.0