Comments (14)
@zerofront 对flex布局初学者来说,各种兼容性入坑少不了,进阶的话,可以使用autoprefixer来处理相关的兼容性问题,但是也会为了实现flex布局而新增很多class来实现对应的布局效果,当然了,也会有人把对应的布局属性封装成class来调用,但是很容易引起class过长的问题。从执行效率上,属性匹配的方式确实是比不上直接class匹配的效率高,但是从维护的角度看,我可以从短短的flex=“main:center cross:centere” 这个字来看出html的基本布局结构,之所以采用属性匹配的方式,也仅仅是因为可以写更少的代码
from flex.css.
感觉 postcss+autoprefixer 是主流发展方向, 你这又是在 flexbox上适配出了一套体系。
from flex.css.
@CandySunPlus 本质上flex.css都是使用autoprefixer编译处理的,能够让你写html的时候,用最精简的代码,快速构建flex布局。
<!-- 自己写flex布局 -->
<style type="text/css">
.box {
display: flex
}
</style>
<div class="box"></div>
<!-- flex.css实现flex布局 -->
<div flex></div>
from flex.css.
@lzxb 想了几天发现还是有点奇怪,违背了结构与样式分离的初衷。但是如果把这个整合成类的话,确实是类名很乱。还是觉得直接写好一些。请问autoprefixer 可以设置兼容uc吗??我作了一个demo,是按列排布的,设置了flex-flow: wrap column 后其他浏览器都可以,而在UC下无法实现父元素高度不够的时候换列。
from flex.css.
@zerofront 这个是无解的,因为-webkit-box不支持。其实这个并矛盾,只是将布局从css中迁移到html中,css中少了布局的代码,然而其他的还是使用css来控制元素的显示风格
from flex.css.
如果不能用flex-wrap的话如何解决垂直排列,但是又要在第一列装不下的时候自动换行到下一列呢?
from flex.css.
@zerofront 这个目前暂时没有解决方法,需要换行的,我目前也是使用浮动布局
from flex.css.
@lzxb 请问 浮动如何实现按列排布??https://www.zhihu.com/question/50584424?from=profile_question_card
from flex.css.
@zerofront 浮动布局,还是自己自己补习一下基础吧
from flex.css.
@lzxb 大哥,不是浮动布局不会,是浮动布局根本不能按列竖直排列下来,只能横着排~~~~~~~~~~
from flex.css.
@zerofront 明白了,我试试
from flex.css.
@zerofront 估计只能使用定位布局,使用js来动态计算了。。。
from flex.css.
想法挺好的。但我选择 Autoprefixer 直接 Chrome 24 配置一下完事。
from flex.css.
@evolutionjay 还是要看各人喜好,想怎么写就怎么写
from flex.css.
Related Issues (20)
- flex overflow make some bug HOT 2
- flex-box="1" 这个样式里面为何没有 flex-basis ? HOT 1
- 请问怎么支持自动换行呢? HOT 1
- ios8出现BUG了 崩溃啊 HOT 1
- DEMO 的源码可以放进这个项目里面吗 HOT 1
- flex=:"box:first" 如果第一个子元素是img的时候,img设置的宽度会被width:auto覆盖 HOT 3
- 是否考虑兼容 class 类写法呢? HOT 1
- ios8.3 兼容性问题; HOT 1
- ios不兼容问题 HOT 1
- 在小程序中引入flex问题 HOT 1
- 有没有方法在小程序里实现一套这种flex.css规则 HOT 1
- 不兼容ios8-ios9,怎么办? HOT 1
- website is broken HOT 11
- 这份css代码可以去更新一下吗?看了是最新两年前的代码@源主 HOT 1
- 在body上使用会有影响 HOT 1
- demo无法查看了,请问是不维护了么 HOT 3
- on olde version webkit dir:top flex-box first children node disappear。 HOT 1
- Demo都下载不了了 HOT 6
- 父 flex="dir:top box:mean" 子 flex-box="0" 子 flex-box="0" 子 flex-box="10" 不生效 HOT 1
- UNI-APP写微信小程序报错 我是import 'flex.css';这样引入的
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flex.css.