flexbox

Bootstrap + Flexbox dynamic height

十年热恋 提交于 2019-12-23 04:33:15
问题 I've added this css for flex-box in bootstrap to my site: http://www.bootply.com/126437 the problem is as follows: it works for both <sections> in my row-flex row-flex-wrap container (the sections have same height) but the content within the 2nd section doesn't stretch to it's maximum parent height. <div class="row row-flex row-flex-wrap"> <section class="col-md-8"> ... some content </section> <section class="col-md-4"> <h1>Welcome</h1> <div class="modcon green"> ... some more content with

CSS Flexbox layout: old version (for working on old browser)

回眸只為那壹抹淺笑 提交于 2019-12-23 04:30:46
问题 I understand that there is 3 version of FlexBox in CSS. Old, Tweener and New : according to: http://css-tricks.com/old-flexbox-and-new-flexbox/ My question: does that versions are different? display: webkit-box; display: box; I know is the OLD syntax version but which one is older? And for older browser compatibility (android browser 2.3) which one do I need to use? 回答1: The correct answer is that -webkit-box and -moz-box are the two you need to use for the 2009 syntax. display: box w/o

Make flex-grow expand items based on their original size

别来无恙 提交于 2019-12-23 04:21:14
问题 I have 3 buttons in a row which all vary in width. I want them to all gain width the same to fill the remaining width of the row, so the widest will still be wider than the others etc. You can see below that what I've tried to do with flex has resulted in all the buttons being the same width. I know flex-grow can be used to proportionally grow each item, but I can't work out how to get them all to grow in relation to their original size. You can see in the second row that the blue item is

css3 flexbox limit 4 items per row auto width

一笑奈何 提交于 2019-12-23 03:13:05
问题 How can I achieve this using flexbox? Currently, I am using table but I wrap every row in a div to limit it to 5 items only. I want all the items wrapped in one parent only. I tried flexbox but I want the items width depends on its content. Thank you guys. .flexContainer { display: flex; flex-flow: row wrap; } .flexContainer .item { padding: 5px; flex: 1 1 auto; } .flexContainer .item a { display: block; background: blue; text-align: center; } <div class="flexContainer"> <div class="item"><a

How to create a dynamic grid using vue?

对着背影说爱祢 提交于 2019-12-23 03:01:18
问题 What is the best way to create a grid dynamically with Vue? I was thinking of using the v-for loop to generate cards on a page for X number of 'modules', but would like to arrange them in rows of 3. e.g Card | Card | Card Card | Card | Card 回答1: You can use CSS grid layout, make sure to check browser support. We'll need to make the container a grid container using display: grid and use grid-template-columns . You can create a component that accepts a number prop and then use it in the repeat(

How to create a dynamic grid using vue?

六眼飞鱼酱① 提交于 2019-12-23 03:01:15
问题 What is the best way to create a grid dynamically with Vue? I was thinking of using the v-for loop to generate cards on a page for X number of 'modules', but would like to arrange them in rows of 3. e.g Card | Card | Card Card | Card | Card 回答1: You can use CSS grid layout, make sure to check browser support. We'll need to make the container a grid container using display: grid and use grid-template-columns . You can create a component that accepts a number prop and then use it in the repeat(

nested flexbox optimization

你。 提交于 2019-12-23 02:59:13
问题 I'm just learning about flexbox, and I'm trying to understand how it works. I have to build a dashboard that has the width and height of the viewport ( no scroll-bar) , a fixed height header, a fixed height footer, and an auto complete height content. The content is composed from a menu with a fixed width, and a preview with an auto complete width and height; I think this can be done only with nested flexbox like in this example: http://jsfiddle.net/03qLy6zL/9/ html <div class="header"> </div

CSS-only masonry layout

╄→гoц情女王★ 提交于 2019-12-23 02:48:47
问题 I need to implement a fairly run-off-the-mill masonry layout. However, for a number of reasons I don't want to use JavaScript to do it. Parameters: All elements have the same width Elements have a height that cannot be calculated server side (an image plus various amounts of text) I can live with a fixed number of columns if I have to there is a trivial solution to this that works in modern browsers, the column-count property. The problem with that solution is that elements are ordered in

React Native FlatList with alternate rows having different number of columns

回眸只為那壹抹淺笑 提交于 2019-12-23 02:46:18
问题 i want to have a FlatList which renders a single item on odd rows and 2 items on even rows Is it possible to achieve this layout. I apologize I do not have code for it up yet. 回答1: FlatList has a renderItem prop which is a function. That function is called for each item which FlatList draws. You have to pass that function to FlatList. In that function, you return the View to be drawn for each item. So you can return whatever you want to draw for a particular row. The renderItem function

can I use flexbox and float at the same time? or use flexbox with absolute positioning?

醉酒当歌 提交于 2019-12-23 01:19:11
问题 for example if I have a 2 column layout (main content and a aside) Can I float the main to the left and aside to left/right and then use flexbox to give the aside an equal height compared to the main content? Do I have to display the whole container to flexbox to include header,main content, aside, and footer or can I just cherry pick one area to use flexbox? 回答1: From Overview, Flex layout is superficially similar to block layout. It lacks many of the more complex text- or document-centric