flexbox

Flexbox resizing

我的梦境 提交于 2020-01-04 09:26:30
问题 I'm trying to come up with an effective way of defining a nested flexbox and allow it to be resized. I think it's almost there: http://jsfiddle.net/6j10L3x2/1/ I'm using three custom elements purely to make the mark-up more declarative: flex, flex-item, flex-resizer A flex represents the container. A flex-item presents an element within the container, and flex-resizer represents a resizer widget which can be placed between two flex-items to add resizing functionality between them. This all

Right align text on display flex

纵然是瞬间 提交于 2020-01-04 07:53:15
问题 My code is as follows : <div className="listContent"> <div> <div className="titleAndCounterBox"> <div className="headerListTitle">{list.name}</div><br /> <div className="headerListExpires"> <div>{formatTime(this.state.remainingTime).days}<span>{language.days}</span></div> <div>{formatTime(this.state.remainingTime).hours}:{formatTime(this.state.remainingTime).minutes}:{formatTime(this.state.remainingTime).seconds}</div> </div> </div> <div><img src={images.header_listInfo_png} /></div> <div

Positioning flex items on top of each other in grid without wrapping them [duplicate]

前提是你 提交于 2020-01-04 06:50:17
问题 This question already has answers here : Is it possible for flex items to align tightly to the items above them? (5 answers) Make a div span two rows in a grid (2 answers) Closed 2 years ago . I have the following layout using flexbox: I want to have the div containing 2 on the right hand side, and the Team and Scorers should make up the space to the left of it. Required layout: It's the same idea as the 2 div having a rowspan of 2, if using a table. Is there a way to position Team and

Flex Footer won't stay at bottom in Chrome

孤人 提交于 2020-01-04 06:19:26
问题 I'm using flexbox to get my footer to stay at the bottom, only when the content is shorter than the viewport. If it is taller, the footer should stay below the content, so that you have to scroll to see it. This works correctly in Firefox and Edge, but not in Chrome or IE. In Chrome, as you'll see, making the viewport shorter than the content leaves the footer "stuck" to the bottom of the view port. If you then scroll, you'll see the footer scroll up the page. I believe the issue is in the

Fill remaining space until max width [duplicate]

…衆ロ難τιáo~ 提交于 2020-01-04 06:06:24
问题 This question already has an answer here : Why don't flex items shrink past content size? (1 answer) Closed 2 years ago . I need to make a panel title with two elements. The first one gets most of the space, while the second gets only the one he needs. The structure is as follow: .flex-child> display: flex .child-1 > flex-grow: 1 .child-2 > align-self: center For stylinng reasons, the first element has a text with white-space: nowrap , to show ellipsis if greater than the parent. But the

Flex items wrapping even with box-sizing border-box

爷,独闯天下 提交于 2020-01-04 05:54:28
问题 In my code below, when I add padding it should add to width since I am using border-box . But it is not working why? Can anyone help me. If I add some margin or padding my child__wrapper is pushed into new line why? * { box-sizing: border-box; margin: 0; padding: 0; } .wrapper { display: flex; flex-wrap: wrap; margin: 0; padding: 0; width: 100%; } .child__wrapper { height: 300px; flex: 0 0 33.3%; margin: 10px; box-sizing: border-box; background: rebeccapurple; } <div class="wrapper"> <div

Why does ::first-letter stop working as soon as I add display: flex or inline-flex?

梦想与她 提交于 2020-01-04 05:53:13
问题 I've implemented some ::first-letter styles for my p elements. However, when I add display: inline-flex to make them inline, all the ::first-letter styles stop working. How can I make the elements inline while keeping the ::first-letter styles? p:first-of-type::first-letter { font-size: 25px; font-weight: bold; } p:nth-of-type(2)::first-letter { font-size: 25px; font-weight: bold; } p:nth-of-type(3)::first-letter { font-size: 25px; font-weight: bold; } /* inline container */ p { display:

Align icon to left and text to center in react native

此生再无相见时 提交于 2020-01-04 05:37:34
问题 I am trying to use flexbox to align my icon to the left of a button view and the text to the center. Currently they are both aligned to the center but I am not sure how to get my icon on the very left edge of the button while keeping the text centered in the view Right now my button looks like this: I am using https://github.com/APSL/react-native-button for buttons and https://github.com/oblador/react-native-vector-icons for icons Below is some of my code: <Button style={signupStyles

Flexbox items do not have equal widths despite flex-basis: 0 [duplicate]

試著忘記壹切 提交于 2020-01-04 04:56:30
问题 This question already has an answer here : Why don't flex items shrink past content size? (1 answer) Closed 11 months ago . I have 4 columns in flexbox, which I want to be of equal width. The one with overflow: hidden takes more place than others, and I can't fix it. It seems to me, then I have the same problem as stated in this post: flexbox and overflow hidden not working properly But the answer did not help me, and I сan't figure out what is the problem with my code. I guess there is

Chrome not properly overriding justify-content for flex box

北城以北 提交于 2020-01-04 03:39:07
问题 I'm having an issue in Chrome 40.0.2214.93 where if I override the justify-content for an element I get some unexpected behavior. I've created a JS Fiddle for this here: http://jsfiddle.net/n670tmeu/ html <header id="top"> <div id="box1"> This is Box 1 </div> <div id="box2"> This is Box 2 </div> </header> css header { background-color: #ccc; width: 100%; display: -webkit-flex; display: -moz-flexbox; display: -ms-flexbox; display: flex; -webkit-justify-content: flex-end; -moz-justify-content: