flexbox

Flex sidebar: how to grow to 100% of height

别来无恙 提交于 2019-12-31 04:21:12
问题 I´m building a sidebar using CSS flex and I need it to grow vertically to fill the whole screen vertical height. Here is a skeleton of what I´m doing. JSFiddle here .app { display: flex; flex-direction: row; . align-items: flex-start; height: 100%; width: 100%; } .sidebar { background-color: red; height: 100%; } .content { width: 100%; display: flex; flex-direction: column; } .content-header { flex: 1; background-color: grey; } .content-main { flex: 1; background-color: yellow; } <div class=

css flexbox break parent by screen width

醉酒当歌 提交于 2019-12-31 03:59:10
问题 if got something like that: <!DOCTYPE html> <html lang="de"> <head> <link rel="stylesheet" href="/styles/screen.css?v=737285430" media="screen, projection" /> </head> <body> <section id="articlesShorten"> <article class="articleShorten"> text1 </article> <article class="articleShorten"> text2 </article> <article class="articleShorten"> text3 </article> <article class="articleShorten"> text4 </article> <article class="articleShorten"> text5 </article> <article class="articleShorten"> text6 <

Width of widest element sets width of all siblings in the row

瘦欲@ 提交于 2019-12-31 01:49:07
问题 I've read a lot of tutorials about CSS flex boxes and CSS grids, but frankly I just can't figure out how to do this simple(?) thing. All I want is for the elements in a container to all be as wide as the widest element. I don't want them to fill up the whole width of the container, just all grow to the maximum width. Can that be done with CSS? Consider this HTML: <div class="container"> <button>a normal button</button> <button>tiny</button> <button>a really, really, really wide button</button

Fitting child into parent

旧街凉风 提交于 2019-12-31 01:41:28
问题 I have nested flex elements with a text at the bottom. The top element has fixed width that is smaller than text: .list-header { display: flex; width: 150px; height: 80px; background-color: #ececec; } .list-component { display: flex; flex: 1; padding-left: 24px; padding-right: 24px; } .header-container { display: flex; flex: 1; } .header-text { display: flex; flex-direction: column; justify-content: center; overflow: hidden; } span { text-overflow: ellipsis; white-space: nowrap; overflow:

Fitting child into parent

為{幸葍}努か 提交于 2019-12-31 01:41:12
问题 I have nested flex elements with a text at the bottom. The top element has fixed width that is smaller than text: .list-header { display: flex; width: 150px; height: 80px; background-color: #ececec; } .list-component { display: flex; flex: 1; padding-left: 24px; padding-right: 24px; } .header-container { display: flex; flex: 1; } .header-text { display: flex; flex-direction: column; justify-content: center; overflow: hidden; } span { text-overflow: ellipsis; white-space: nowrap; overflow:

Exclude element with fixed positioning from justify-content in flex layout [duplicate]

时光总嘲笑我的痴心妄想 提交于 2019-12-30 22:51:35
问题 This question already has answers here : Absolutely positioned flex item is not removed from the normal flow in IE11 (4 answers) Closed 2 years ago . I'm currently trying to build a responsive website layout with flexbox. Depending on the screen size I want an element to have position: fixed; This itself is working. But when I use justify-content: space-between; on a column that contains an element that gets moved out of the of column itself with position: fixed; the space distribution uses

IE 11 ignores min-width when using flex width

六眼飞鱼酱① 提交于 2019-12-30 18:49:32
问题 I'm wondering if someone can help with this problem. I spent a lot of time on it and I'm all out of ideas, I've tried various suggestions from Google results, various combinations of flex grow and shrink, and couldn't get it working. Demo: https://embed.plnkr.co/dIPh53W4DBkmTB51DCHp/ (open with IE 11) Edit the code: https://plnkr.co/edit/dIPh53W4DBkmTB51DCHp?p=preview In this case, in tablet view the <ul> flex width should be 90%, but in desktop view the <ul> flex width should only be 55%.

IE 11 ignores min-width when using flex width

£可爱£侵袭症+ 提交于 2019-12-30 18:49:01
问题 I'm wondering if someone can help with this problem. I spent a lot of time on it and I'm all out of ideas, I've tried various suggestions from Google results, various combinations of flex grow and shrink, and couldn't get it working. Demo: https://embed.plnkr.co/dIPh53W4DBkmTB51DCHp/ (open with IE 11) Edit the code: https://plnkr.co/edit/dIPh53W4DBkmTB51DCHp?p=preview In this case, in tablet view the <ul> flex width should be 90%, but in desktop view the <ul> flex width should only be 55%.

Flexbox item with overflowing content only works on Chrome

天大地大妈咪最大 提交于 2019-12-30 17:56:53
问题 Please take a look at this pen: https://codepen.io/linck5/pen/gRKJbY?editors=1100 body{ margin: 0;} .container { width: 100%; height: 100vh; display: flex; flex-direction: column; } .top-bar { background-color: darksalmon; height: 50px; } .inner-container { flex: 1; background-color: chocolate; width: 100%; height: 100%; display: flex; flex-direction: column; } .top { background-color: blueviolet; flex: 1; overflow: auto; font-size: 40px; line-height: 5rem; } .bottom { background-color:

nested flex elements don't make parent grow

寵の児 提交于 2019-12-30 10:53:09
问题 I'm trying to compose a header with month names and all days in that month right below the name. Days items have fixed width so I thought: why not use flexbox? For some reasons .day elements are falling of their parent and parent does not grow. Could you please give me a hint why flex-basis: auto doesn't make month-slot grow after days' slot overflow it? As for implementation I've already found workaround with using float: left instead of using flexbox. But I cannot understand why it works