Quantcast
Channel: Active questions tagged flexbox - Stack Overflow

CSS: Maximize DIV and keep aspect-ratio

I want my canvas to be as large as possible, but keep the aspect ratio. It should work if the screen gets less wide as well as when its height decreses.Basically, I want the screen at the top of the...

View Article


pixi.js application in "flex: 1" div grows vertically

On load, my pixi.js app fills the available space provided by the flex layout. But when I resize the window, the app starts grow vertically and I get a vertical scrollbar. How can I make the app...

View Article


Image may be NSFW.
Clik here to view.

Align icon vertically to the center of the first line of text

Here are the eyes with align-items: center property. They are OK for one-line text and FAIL for multiline text:Here are the eyes with align-items: baseline (or flex-start). They are better for...

View Article

Image may be NSFW.
Clik here to view.

align elements in 2 rows in flexbox

I have 5 Elements I want to align in 2 rows, the first row with 3 elements with the same width and in the second row, one element 2/3 width and the other one 1/3<div class="container"><div...

View Article

How to make Flexbox items the same size

I want to use Flexbox that has some number of items that are all the same width. I've noticed that Flexbox distributes the space around evenly, rather than the space itself.For example:.header {...

View Article


Image may be NSFW.
Clik here to view.

Why isn't my flex item (figure containing an image) not centering but my...

Hopefully the image I've marked up describes the issue easily enough. The red bordered figure containing the image is not centered, despite the paragraph above centers fine. Both elements are in the...

View Article

Image may be NSFW.
Clik here to view.

How to align flexbox elements without clipping under Grid column, or...

I have a grid column layout of: [full-width] [breakout] [content] [breakout] [full-width].Within the [breakout] column I have an icon, and in the [content] column I have a section header, and...

View Article

Image may be NSFW.
Clik here to view.

How to style select with form-control style so that it aligns on the left...

I notice that if I use flexbox with a select and input, both with form-control style, that they do not align on the left (I have put that text in bold as people do not seem to understand the problem)....

View Article


How do I get CSS "width:auto" to give sizing priority to text alongside it...

I am using width:auto to have an image look reasonably sized on both desktop and mobile. My problem is that the image takes sizing priority to fit on the screen and bunches the text up on the right. I...

View Article


Image may be NSFW.
Clik here to view.

CSS flex item not expanding with content in Firefox with writing-mode:...

I am experiencing a specific issue in Mozilla Firefox with flex containers when using writing-mode: vertical-lr. The flex items are not expanding to fit the content, causing the text to...

View Article

Why doesn't "" cause a line break in a flex container, but "" does? [closed]

Playing with flex containers, I wanted to add some line breaks at specific positions.So I tried this:.break { flex-basis: 100%; height: 0;}When I inserted <br class="break" />, then the line just...

View Article

Responsively size an inner container within limits

maybe it's just too late on a Friday but I can't get this fixed and can't find an example and I feel like I'm going in circles.I have a row of three containers: A, B and C, where B is a wrapper for two...

View Article

Horizontal and vertical centering of content (I don't understand one thing)

I am on my first steps on using Flexbox.How can I move the image title below the image?<div class="flexbox-container"><div class="flexbox-child"><img...

View Article


Flexbox with multiline text ellipsis

I've been using the white-space: no-wrap, text-overflow: ellipsis, and overflow: hidden CSS properties to create ellipsis truncation for multiline text. However, this doesn't work when using...

View Article

Bootstrap flex container shifts content when inserting SVG

I have a flex container with inline elements. In this example everything is vertically-aligned properly...<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css"...

View Article


Image may be NSFW.
Clik here to view.

Define css rules for dynamic column arrangement

I want to define a set of css rules to accomplish the following effect: I have a variable amount of child items of fixed size that need to be arrange in columns. If the items reach a certain height,...

View Article

Image may be NSFW.
Clik here to view.

Why adding border to Grid Display children behaves differently than Flex...

Using the following HTML why adding border mis-aligns the children:https://jsfiddle.net/7dp2uqe8/<style type="text/css"> .flex { display: flex; } .flex-item { flex: 1 0 0; text-align: center; }...

View Article


Chatbox with new messages showing at the bottom and pushing old messages up

I am kinda stuck building the chat container of a chat gpt-like UI. The tricky part is that I want the messages to start from the bottom with new messages pushing the old ones further to the top. The...

View Article

Image may be NSFW.
Clik here to view.

CSS print and Flexbox

Hello I would like to create some page using css print.I looked around and the web I tried some stuff but saddly the alignment is not working.The Layout I want to produce:here is my html <section...

View Article

Image may be NSFW.
Clik here to view.

Content not visible during scorling in Angular component

In Angular, I have three components header, lefpanel and router-outlet for all other component data/page need to display. The initial component introduction have some contents, but only partial content...

View Article

Make a flex container scroll

I have a flex container with this styles:section { width: 100vw; height: 100vh; display: flex; overflow-y: scroll; justify-content: center; align-items: center; flex-direction: column;}this section has...

View Article


Image may be NSFW.
Clik here to view.

Flexbox float right

I am looking for solutions on Flexbox layout best practice for a common use case.In the example, I want to use Flexbox to make the score number to be float to the right. I thought of using:position:...

View Article


overflow: scroll on div with flex: 1 without specific height

I have a flexbox layout kinda like Discord.My list is the messageList with all messages I have.I want to add overflow-y: scroll to it but it doesn't work because I don't have a specific height.Also, I...

View Article

Image may be NSFW.
Clik here to view.

Using bootstrap to center 1 div and place another one next to it [duplicate]

I'm trying to use Bootstrap's d-flex in a slightly different way than in this example:My aim is to have the "Content" box and the "Justify" box being shown, but not the "Center" box without changing...

View Article

CSS 100vh offset by header

I have this pen here: https://codepen.io/anon/pen/wPdrodAs you can see (at least in Chrome and Firefox), there are 2 vertical scroll bars. There should only be the inner one, as the header should...

View Article


Justify inner flex-box in center of parent div [duplicate]

I have a series of dynamically created 'content' boxes that I need to justify left and flow to a new row depending on screen size. This part is working, however I want to get the div that contains...

View Article

Making a flex item float right

I have.parent { display: flex;}<div class="parent"><div class="child" style="float:right"> Ignore parent? </div><div> another child </div></div>For my first child, I...

View Article

Image may be NSFW.
Clik here to view.

How to avoid empty space on flex container with wrapped contents?

I have a simple input field that sits on a single line but wraps when there is not enough space, using CSS flexbox.I would like to center this field, but when wrapped, it leaves empty space on the...

View Article

Image may be NSFW.
Clik here to view.

Angular mat-form-field not resizing in flex-box

I am trying to use Angular material form field along with flex-box, but unable to make them shrink on screen resize, i am sure i am missing some flex-box property or style, please help me in fix this...

View Article



React Native and FlexLayout both depend on Yoga — duplicate definition error

I’m building some native Swift code that uses FlexLayout, which has a dependency on Yoga. When I integrate this with React Native and try to compile, I run into a “duplicate definition” error because...

View Article


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>