flexbox

Align content in a flex container to the bottom

家住魔仙堡 提交于 2020-01-24 20:17:07
问题 Is there a way to have equal height items in flexbox and align all of the content within that container to the bottom? Currently this is what I have .quick-menu .menu { font-size: 0; display: flex; flex-wrap: wrap; justify-content: space-between; } .quick-menu .menu .item { margin-top: 30px; width: 33.33%; align-self: flex-end; } .quick-menu .menu .item > img { margin: auto; } .quick-menu .menu .item > span { font-size: 24px; font-weight: $bold; color: $white; text-align: center; display:

Center span element under an image element (Ionic2)

一个人想着一个人 提交于 2020-01-24 20:04:33
问题 How to centralize this span under the avatar using flex? The avatar image is well centralized if I remove the span, but when I insert the span, even with display:block it displays on the right side. Here is my HTML : <ion-navbar *navbar> <ion-avatar item-center> <img src="img/bill-gates-avatar.jpg"> <span>Bill Gates</span> </ion-avatar> </ion-navbar> <ion-content padding> Content here... </ion-content> That is my SCSS : .tabs { ion-navbar-section { min-height: 16.6rem; } .toolbar { min-height

Flexbox optimal fill

核能气质少年 提交于 2020-01-24 13:54:25
问题 I have a basic flexbox column-wrap layout with a fixed width container and fixed width variable height elements inside it. for (let e of document.getElementsByClassName('element')) { e.style.height = Math.floor(20 + Math.random() * 50) + 'px'; } #container { border: 1px solid blue; display: flex; flex-direction: column; flex-wrap: wrap; width: 1000px; /* height: 160px; */ } .element { margin: 10px; background-color: lightgreen; width: 100px; } <div id="container"> <div class="element">Element

Flex items with same property values are rendering in different sizes

血红的双手。 提交于 2020-01-24 12:44:05
问题 I'm using Flexbox to make a responsive site (first time I've done either of those, bear in mind) and it was all going well until I realised at some point that flex items with the same properties weren't behaving the same way. Have a look at this, I had some issues with the page in Chrome even though I ran the CSS through Autoprefixer, but that's another issue. If you have issues with this, it might be an idea to open it in Safari, which I started testing it in. You'll have to narrow the JS

CSS Columns, Top to Bottom then Left to Right

对着背影说爱祢 提交于 2020-01-24 12:32:15
问题 I'm building a newspaper style layout for an app. My page is split into 8 columns, and the columns should fill vertically first then horizontally. If there isn't enough content to fill the page, the columns should still fill vertically first leaving white space to the right of the page. Currently they fill horizontally first leaving white space bellow the content. I've tried this with CSS columns but it seems to always fill the width of the page, I can't see a way to change this. I've also

CSS Columns, Top to Bottom then Left to Right

陌路散爱 提交于 2020-01-24 12:31:13
问题 I'm building a newspaper style layout for an app. My page is split into 8 columns, and the columns should fill vertically first then horizontally. If there isn't enough content to fill the page, the columns should still fill vertically first leaving white space to the right of the page. Currently they fill horizontally first leaving white space bellow the content. I've tried this with CSS columns but it seems to always fill the width of the page, I can't see a way to change this. I've also

css Flex div grow as child textarea grows (no jquery) [duplicate]

前提是你 提交于 2020-01-24 12:28:53
问题 This question already has answers here : CSS Textarea that expands as you type text (17 answers) Make input element (type=“text”) handle multiple lines of text (3 answers) Closed 2 years ago . Imagine I have the following div{ padding: 20px; } <div style="display:flex; background: gold; flex-direction: column;"> <textarea>Do NOT expand this</textarea> <textarea class="expand">Expand this baby</textarea> </div> I want when content on textarea "expand" creates vertical overflow for it to expand

Using flexbox shrink column only if it is wider than half of the container

主宰稳场 提交于 2020-01-24 11:14:19
问题 Please look at my drawing: Here is description: (1) I have a flexbox with two columns. I want it to work as follows: When one of the boxes bigger than half of the width and there is a space for both boxes, then do nothing. (or stretch both proportionally) (3) If one of the boxes bigger than half but both boxes don't fit - than shrink only the one that is bigger than half. (4) If both boxes bigger than half - shrink both proportionally. This is an example where I want to see this to happen:

Using flexbox shrink column only if it is wider than half of the container

前提是你 提交于 2020-01-24 11:12:25
问题 Please look at my drawing: Here is description: (1) I have a flexbox with two columns. I want it to work as follows: When one of the boxes bigger than half of the width and there is a space for both boxes, then do nothing. (or stretch both proportionally) (3) If one of the boxes bigger than half but both boxes don't fit - than shrink only the one that is bigger than half. (4) If both boxes bigger than half - shrink both proportionally. This is an example where I want to see this to happen:

React-Native: Avoid Text Wrapping

房东的猫 提交于 2020-01-24 02:10:09
问题 I have the title of a song and its duration showing in one line. The song title needs to show an ellipsis but the duration should never wrap or show ellipsis. I've tried several combinations but fail to make this work right for long titles. The duration either goes off screen when the name shows ellipsis or the duration wraps. I can't hardcode a fixed width on the duration as it can change size. <View style={{flexDirection: 'row'}}> <Text numberOfLines={2} style={{fontSize: 16, textAlign: