flexbox

CSS Grid to have minimum number of columns possible with auto flow after wrapping

梦想与她 提交于 2020-04-17 16:55:40
问题 Is it possible to have a CSS grid with auto flow that minimises the number of columns after wrapping? How? I have a grid with 6 items with auto-placement. Once not all 6 of them fit in one row, I'd like to have 3 columns and 2 rows, instead of 5 columns and 1 row, with only one element on the second one. I'd like to avoid media queries, if possible. A visual representation of what I'd like to do: 1) If all 6 items fit in one row, show them in one row. | OOO OOO OOO OOO OOO OOO | | O1O O2O O3O

CSS Grid to have minimum number of columns possible with auto flow after wrapping

倾然丶 夕夏残阳落幕 提交于 2020-04-17 16:51:32
问题 Is it possible to have a CSS grid with auto flow that minimises the number of columns after wrapping? How? I have a grid with 6 items with auto-placement. Once not all 6 of them fit in one row, I'd like to have 3 columns and 2 rows, instead of 5 columns and 1 row, with only one element on the second one. I'd like to avoid media queries, if possible. A visual representation of what I'd like to do: 1) If all 6 items fit in one row, show them in one row. | OOO OOO OOO OOO OOO OOO | | O1O O2O O3O

CSS: Make Flexbox's justify content only overflow to the right [duplicate]

南楼画角 提交于 2020-04-13 03:24:53
问题 This question already has answers here : Can't scroll to top of flex item that is overflowing container (7 answers) Closed 2 years ago . I have a dynamic number of divs in a single container div with display: flex . Now, I want my child divs to be centered, so I use justify-content: center . This works perfectly for a small number of children (the blue rectangles) But for a larger amount of children, setting justify-content: center means that child divs are pushed farther and farther off

Why doesn't justify-content: stretch work?

ぐ巨炮叔叔 提交于 2020-04-12 10:50:10
问题 Why does the code below not stretch my 100px items? The results are basically close to this: [100px|100px|100px|.........] That looks a lot like flex-start, not flex-stretch. Is this the intended behavior? I'm looking for: [...100px...100px...100px...] .box { display: flex; justify-content: stretch; width: 500px; } .item { width: 100px; } <div class="box"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> </div> 回答1: Because - if you want the items to stretch in

Why doesn't justify-content: stretch work?

筅森魡賤 提交于 2020-04-12 10:49:35
问题 Why does the code below not stretch my 100px items? The results are basically close to this: [100px|100px|100px|.........] That looks a lot like flex-start, not flex-stretch. Is this the intended behavior? I'm looking for: [...100px...100px...100px...] .box { display: flex; justify-content: stretch; width: 500px; } .item { width: 100px; } <div class="box"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> </div> 回答1: Because - if you want the items to stretch in

Why doesn't justify-content: stretch work?

一曲冷凌霜 提交于 2020-04-12 10:49:10
问题 Why does the code below not stretch my 100px items? The results are basically close to this: [100px|100px|100px|.........] That looks a lot like flex-start, not flex-stretch. Is this the intended behavior? I'm looking for: [...100px...100px...100px...] .box { display: flex; justify-content: stretch; width: 500px; } .item { width: 100px; } <div class="box"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> </div> 回答1: Because - if you want the items to stretch in

CSS flexbox width 100% Firefox

别说谁变了你拦得住时间么 提交于 2020-04-08 10:23:11
问题 I'm having an issue with this scenario in Firefox. #pager takes the width of its children. However, in Chrome, it takes the width of its parent. How can I make #item-list respect the width of its parent in Firefox? take a look! https://jsfiddle.net/owmpatbh/2/ HTML: <div id="wrapper"> <div id="sidebar"></div> <div id="main"> <div id="content"> <p id="stuff">blahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblahblah</p> </div> <div id="pager"> <div id="item-list"> <div class=

Flexbox align items horizontally [duplicate]

拥有回忆 提交于 2020-04-08 09:19:29
问题 This question already has answers here : In CSS Flexbox, why are there no “justify-items” and “justify-self” properties? (4 answers) Closed 3 years ago . Is there a method to align child items in that way: [i][i]______[i][i][i], regardless how many items are in each of the groups? 回答1: In a Flexbox Container Use justify-content for the alignment of items horizontally . Use align-items to align items vertically . Have a look at the example snippet below: .parent { display: flex; width: 100%;

white-space: nowrap; and flexbox did not work in chrome

你说的曾经没有我的故事 提交于 2020-04-08 08:57:50
问题 Recent update of Chrome breaks white-space: nowrap using text-overflow: ellipsis; on a overflow: hidden element. How to fix that without adding hard-coded width on name class.. <h1>problem</h1> <div class="container"> <div class="name"> <div class="firstname"> test </div> <div class="lastname"> as kjldashdk ja asdjhk ashdjk ashdjk asdjasdkajsdh akjsd asd asd asd asd asd asd as das da asdas dasd asda sdasd as dasd asd asd as dasd a </div> </div> <div class="side"> options </div> </div> The

zhilizhili-ui 荡平ie8910 还我前端清净地

可紊 提交于 2020-04-07 21:15:16
zhilizhili-ui 给大家带来一个目前最新版本的ie8方案 特色 flexbox部分功能 vw vh calc部分功能 angular1.4 todo avalon是因为无法和polyfill.js和谐共处 无法使用flexbox 真可惜 webcomponent 无法在ie8 ie9上使用 也就无法解决这些问题了 不过cordova解决方案里会有 flexbox flexbox 我使用的是 flexibility.js github地址 作为兼容方案 那么作为一款快速开发的方案 emmet 解决方案也是会有的 我举个例子 如果想要使用一个flex row layout 就可以直接在sublime中输入zen-flex-row 变成预设语句 .layout.flex.horizontal>.layout__item* 再变成相应html代码 webcomponents 版本不太一样 具体之后文章给出方案 注意 不过注意的是flexibility 无法正确计算外部长度 justify-content 全部属性可以通过测试 为什么没撑满 因为设置了高度 ie8 ie9测试截图 一样效果 不重复截图 align-items 全部属性可以测试通过 这里再说一下 一个注意点 flex布局item是height撑满的 不是100% 注意效果一样而已