Flexbox `width: max-content` and CSS specs [duplicate]
My question is somewhat academic because a practical solution to my problem is simple. However, I would like to understand precisely what and why happens from the CSS specification standpoint.This...
View ArticleHow to stretch and center an element inside flexbox along cross axis?
I'm trying to get an item in a flexbox layout to fill all available space inside the container if it can, or be centered if it can't due to its max-width/max-height constraints. In the snippet below,...
View ArticleChange flex-direction for mobile layout
I have 3 divs (A, B, C) where A is positioned at left and BC are positioned at right.But for mobile layout I want to have them positioned like the image below...where C is positioned at left and AB are...
View ArticleFormat flex items based on wrap state
I am using Flexbox for following layout and willing to switch to CSS Grid or plain old floats if I can achieve my goal. This questions is very similar these two: detect flex wrap and select an item...
View ArticleHow to detect CSS flex wrap event
I have flex container with items inside. How to detect flex wrap event? I want to apply some new css to elements that have been wrapped. I suppose that it is impossible to detect wrap event by pure...
View ArticleCan flexbox detect when a flex item wraps?
I am hoping to get rid of media queries and just use flexbox to solve my problem, but I'm not sure if this is possible. As the window gets smaller, I want the columns to shrink until they hit their...
View ArticleSpan five side by side regions equally in oracle apex
I have a screen where there are five regions side by side. Because apex works on the basis of 12 grid columns, I am facing an issue where five regions are not spanning horizontally equally basically...
View ArticleDisplay list in several columns and keep the number of elements per column...
I simply need to have an unordered list displayed in 3 columns, but without vertical alignment.Is there a way to remove the gap between the list element no. 2 and no. 5 in this example?I already tried...
View ArticleWhy is my Flexbox navbar with a left-aligned logo and right-aligned menu not...
I am trying to design a navbar where the "SushiMan" heading is aligned to the left and the other list items (Menu, Food, Services, etc.) are aligned to the right. The layout works fine when I follow a...
View ArticleHow can I make absolutely positioned elements in a column fill the height of...
I do have a problem with this (flex) layout. I do have a parent container. Inside there are two columns, the left column #1 contains absolutely positioned objects and the right column #2 contains...
View ArticleWhy is flex align not centering the div? [duplicate]
I want to figure out what went wrong with the following code when trying to center my div horizontally and vertically. I tried justify-content and align-items. It stays stuck at the top..bodycontainer{...
View ArticleHow to adjust line height without messing up the text's "hitbox"
I have a title with slogun underneath in my header.However, by default those 2 lines of text have WAY too much space between them, so i figured id use line height, which fixes the issue perfectly.....
View ArticleGet flexbox to set several elements to same height on main axis
I'm designing a little modal to allow me to select a bunch of filter criteria. I have several filtering categories which I want to present separately. Here's the design intent:In this example, the...
View ArticleHow prevent React Native FlatList height from changing when the content changes?
I have a main View with a top view and a bottom view, in the following flex configuation:container view: flex 1 (fills the whole height) -header view: flex 1 (fills 25% of the container) -bottom view:...
View ArticleCSS Grid/Flexbox Dynamic Displaying
I would like to display 8 elements in the page by the following rules. I am surprised that ChatGPT cannot give a proper solution after trying many times...The rules are as simple as the following,...
View ArticleFlexbox items in three columns
I have a flexbox container that will contain 5 or 6 items. flex-direction of the container will be set to row. What I want is to distribute those items like this: The first item should be the first...
View ArticleMake a column take up available space in a flex container with wrap
I have a layout like this:.container { background-color: yellow; display: flex; flex-wrap: wrap;}.col-x { flex: 0 0 5rem; background-color: red;}.col-y { flex: 1 0 auto; background-color:...
View ArticleWhy is percentage height ignored when nested within multiple flex boxes with...
This is a very contrived example to distill the problem I'm observing. I know I can work around it, but I still want to understand why this doesn't work the way I expect it to. I'd basically like to...
View ArticleMake the first child of the next sibling fill up the remaining screen height
There are many examples here on Stack Overflow and on the internet that explain how to make a sibling element fill up the remaining vertical screen space using flexbox, for example this highly upvoted...
View Articlecss flex-wrap, but vertically?
5 children elementsequal widthsvarying heightsI would like to do EXACTLY what flex wrap row does, but VERTICALLY..container { display: flex; flex-wrap: wrap; flex-direction: column; gap: 5px; border:...
View Article