flexbox

Can't get my buttons to align correctly using flexbox

拜拜、爱过 提交于 2019-12-24 11:37:38
问题 I am using flexbox to format three divs so that they have the same height (no matter the content). I am trying to align the buttons inside those divs at the bottom of the divs (all vertically aligned), but I can't get it to work. I have tried to use align-content and justify-content in any way I could think of... Here is the "clean" code where I removed everything I tried to align the buttons and kept only the working code. .container .row { @include flex; @media screen and (max-width:

overflow scroll-y not working with flexbox

微笑、不失礼 提交于 2019-12-24 10:48:29
问题 I'm trying to "stack" divs on top of each other as new div boxes ( .dialog-box ) are added to the parent container ( .dialog-container ). To stack the elements, I'm using the following on the parent: display: flex; flex-direction: column; justify-content: flex-end; I'd like to scroll that container for .dialog-box s that are overflowing, yet with flex-box the overflow-y: scroll; is not scrolling. Two boxes: (fill up container from bottom to top as expected): Six boxes (expands outside the

How to center image when it's smaller than parent and put in top left corner when it's bigger?

删除回忆录丶 提交于 2019-12-24 10:44:54
问题 When I have small image (eg. 100x100) and it's parent is bigger (eg. 200x200) then I want the image to be centered both vertically and horizontally in the parent. But when image is wider (eg. 300x100) than the parent (200x200) I want it to be placed on the left side of the parent and have a horizontal scrollbar to scroll and see the whole image. When image is higher (eg. 100x300) than the parent I want it to be placed at the top of the parent and have vertical scrollbar to be able to see the

Why is Firefox not honoring flexed div's height, but Chrome is?

你离开我真会死。 提交于 2019-12-24 10:01:25
问题 This is best illustrated with a simple example. I have a container with display: flex and flex-direction: column , with a single div inside with height: 300px and flex: 1 . Chrome renders the nested div at 300px tall, but Firefox renders it as a single line. Is this just a nuance between the implementation of flexbox between the two browsers, or is this bad code somehow? If a nuance, what's the best way to mitigate? .container { display: flex; flex-direction: column; } .container > div {

Make contents of flex item scroll instead of making container taller [duplicate]

本秂侑毒 提交于 2019-12-24 10:00:01
问题 This question already has answers here : Prevent flex item from exceeding parent height and make scroll bar work (2 answers) Closed 5 months ago . I have a dialog box: $(document).ready(function() { $('.ui.modal').modal('show'); }); .content { display: flex !important; flex-direction: column; } .ui.modal > .content > .scroll { flex: 1; } <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <link href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.7.6/dist

how to use display flex instead of float left and float right

牧云@^-^@ 提交于 2019-12-24 09:54:17
问题 How to use display flex instead of float: left and float: right ? See below image I tried like this: body { padding: 0; margin: 0; font-family: 'Open Sans', sans-serif; font-size: 16px; } a { text-underline: none; } .bg { background: #eee; } .header { display: flex; background: #af2c2c; } .logo h2 { color: #fff; font-family: "Times New Roman", Times, serif } .menu_hang { background-position: -70px -92px; background-image: url(https://static.toiimg.com/photo/52121907.cms); background-size:

CSS Flexbox - Truncated Text in CSS Grid (Firefox only) [duplicate]

回眸只為那壹抹淺笑 提交于 2019-12-24 09:51:51
问题 This question already has answers here : Prevent content from expanding grid items (3 answers) Closed 2 years ago . I can easily render a flexbox with some text and a button, where the text will shrink and truncate with an ellipsis if its container shrinks: .titleBarCtr { align-items: center; display: flex; } .titleBar { color: white; background-color: green; flex: 1; height: 44px; line-height: 44px; margin: 0; padding-left: 5px; text-align: left; } .titleBarCtr .icon { background-color:

Text is not wrapping inside flexbox in IE EDGE

社会主义新天地 提交于 2019-12-24 09:37:21
问题 I have a UL set to display: flex and lists with flex-grow: 1 , so that all items will take equal spacing. Inside each list item, I have a link set with display: flex , justify-content and align-items set to center. When the window is too small to display all items, text inside the LINK will wrap in Chrome and FF but not in IE Edge :( I have not found a solution so far. All help is much appreciated. * { box-sizing: border-box; } ul { display: flex; margin: 0; padding: 0; } li { list-style:

Why doesn't the nested flex parent height grow with children?

Deadly 提交于 2019-12-24 08:20:40
问题 In this codepen the children overflow the parent height but why does the flex parent height not grow with children? I can use display:block to achieve it, but I would want it to be flex. html,body{ height:100%; } .grand-parent{ height:100%; overflow:auto; display:flex; } .parent{ display:flex; flex-direction:column; min-height:100%; flex-shrink:0; width:100%; } .child{ height:1500px; width:100%; display:flex; flex-shrink:0; } .green{ background:green; } .blue{ background:blue; } <div class=

flex-grow isn't rendering correctly in Internet Explorer 11 (IE11)

て烟熏妆下的殇ゞ 提交于 2019-12-24 08:06:24
问题 I tried a new html design with flex boxes. The design in Chrome 58 Version 58.0.3029.110 is correct but not in IE11. I did not tried other browsers. What is the issue? body { display: flex; flex-flow: row wrap; } #left { flex: 6 0%; display: flex; flex-flow: row wrap; } #right { flex: 1 0%; background-color: black; } #top { flex: 1 100%; background-color: red; } #nav { flex: 1 0%; background-color: green; } #main { flex: 6 0%; background-color: blue; } #notepad { flex: 1 0%; background-color: