Format 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 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 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 ArticleHow to Stop a Div from Growing Beyond Its Parent’s Height in a...
I’m working on a React application using TailwindCSS, and I’m having trouble stopping a div that holds a list of tasks from growing vertically beyond the desired height limit. I want the div to take...
View ArticleHow to show 2 Boxes in front of one Tall Box using MUI Stack or flex Box
I am working on a dashboard layout where widgets can be of different size.I am using MUI Stack. I have a requirement where if I add a 1 tall widget (double the height of small widget) and 2 small...
View ArticleFlexbox & Grid Issue: Image Block Shrinks Unexpectedly on Small Screens
I have a layout where .digital__main is a flex container, and inside it, .digital__section is a flex child that contains a .digital__list using display: grid. Each grid item (.digital__item) contains...
View ArticleHow to make flex items wrap until container's height is reached, then shrink...
I'm working on a layout using CSS flexbox and facing an issue where I want my flex items to behave in a specific way when the browser window is resized:Desired Behaviour:When the window width...
View ArticleHow to get text to expand with parent element width? (exactly!) [duplicate]
I am attempting to make a div which resizes itself dynamically across my webpage and I am wanting text to scale up and down with the parent div's width.So far i have not been able to do this as font...
View ArticleUnable to align title of vertical stepper to be at the same level of the circle
I'm building a vertical stepper component in React with a title inside a circle that has absolute positioning. The problem is that since the title is absolutely positioned, it doesn't grow or expand...
View ArticleWhy can I not vertically align a button in a div in Angular?
I have spent way more time on this than any human should, I been through at least 30 solutions on Stack before posting this, as I know it is a VERY common issue. So I apologize for making my own post...
View ArticleBorders of Div element are not the height of the flex box
I am making a navigation bar for a website. I am doing this through the flex box system. The flexbox container has three different DIV elements, two of which have an A element and one with a p element...
View ArticleImage inside flex parent with max-height and max-width and object-fit contain
Image stretches if I don't use object-fit contains. Stretches in width, losing aspect ratio. object-fit contain fixes that. The problem is, the element itself is not contained, just the visible image....
View ArticleCalculate the height of the visible part of a flex item (regardless of its...
I'm trying to zoom children of a container to make it fit the container's height. The container is a flexbox item and may share the available space with other elements, i.e. a heading.My problem is...
View ArticleWrapping inline-flex container gets wrong width in Firefox. Any workaround?
I want to display form fields horizontally with label above fields, but for checkboxes I want to stack them 2&2.I place all consecutive checkboxes in a wrapping inline-flex container with...
View ArticleHow to maximize the space between characters/letters in a div (like with...
I've been Googling around but haven't found a way to make the letters in a div take up all the horizontal space available and maximize the space between them dynamically (like with CSS flex...
View ArticleCSS Flex Overflow Clipping Top [duplicate]
Fiddle here: https://jsfiddle.net/2675tu34/1/So when you stretch out the display area in red, the green box centers nicely vertically and horizontally. However, when you make the area smaller so that...
View ArticleCan I change the "justify-content" value depending on the number of elements...
I am working on an image gallery on a legacy site. I can't use anything other than regular old HTML/jQuery or JS/CSS. I know this would be a lot easier with Bootstrap or some grid library.I'm building...
View ArticleHow can I combine flexbox and vertical scroll in a full-height app?
I want to use a full-height app using flexbox. I found what I want using old flexbox layout module (display: box; and other things) in this link: CSS3 Flexbox full-height app and overflowThis is a...
View ArticleSmall gap that keep the page scrolling even with an height of 100vh
I'm designing an HTML/CSS page with the following features:two column templatethe left column (let's call "menu") has three subsections:headercontentfooterthis left column should fill the vertical...
View ArticleHow can I use a rotated, repeating background image (inside a partially...
I want to create fancy borders for an element but the vertical lines are giving me troublethe right side looks correct in this example but only works for this specific size (which i don't want) and...
View ArticleHow to get flex grow to work with shadcn scroll area?
Im trying to make a scroll area use flex grow so as to be the available height of the parent.<div className="w-4/5 px-[3%] flex flex-col flex-grow"><Navbar /><div className="flex...
View Article