Bootstrap 5 justify-content-center not working with a child div with flex-wrap
I want the cards on my webpage to wrap from left to right when the horizontal space on the page runs out. If I use justify-content-center with flex-wrap directly (in the same div) then the cards are...
View ArticleHow to create dynamic squares using flexbox?
I am having a few difficulties setting up the dynamic portion of the sketch project I am doing. The idea that I want to implement next is that the amount of squares (divs) changes inside the...
View ArticleLayout a flex box similar to a table?
I'm working with a framework developed in-house which depends on a certain structure to our HTML. And one of the tricky things is that each row needs its own container with its own classes and data...
View ArticleCreating a 1:1 ratio element, centered within another element
I am attempting to create some rectangular boxes with circular (not ovular) boxes inside those. Currently the behaviour I'm getting is this:Whereas the behaviour I was expecting was circles (i.e. 1:1...
View ArticleStop flexbox from altering child dimensions in any way
I have the following markup on my page:<h1 id="some-fragment"><a href="#some-fragment" class="fragment-link"><svg height="16" width="16" viewbox="0 0 24 24" fill="none" stroke="#000"...
View ArticleHow to center a text in its own border using css and html
BeforeAfter(Note:1.Using grid and flex2. Don't mind the language (Vietnamese)3. This is my first time asking for help in Stackoverflow4. If you have some "language" problems in the code , please...
View ArticleWhy doesn't the flex child shrink in this simple test case webpage?
I had a webpage which was working perfectly and resized the child canvas element (the checkerboard with a bunny), while keeping its 1:1 aspect ratio with a help of ResizeObserver, when the browser...
View ArticleWhy don't the flex items have the same height if I set flex-grow: 1?
:root { --primary-color1: #262424; --primary-color2: #fff; --secondary-color: #f3f3f3; --link-color: rgb(101, 101, 195); --link-hover-color: rgb(2, 2, 222);}p { text-align: center; margin-top:...
View Articleow to properly layout similar header blocks
Help please, I can’t understand how to correctly lay out such a block in the header, there is a container (1440px doesn’t matter) inside of which there is a logo pressed to the left side, how to make...
View Articledisable shrink of grid elements
I'm doing a pet project and I get a problem. I need two div's in the grid to have the same height on mobile devices and i want to add scroll when they overflow. But now the upper one squeezes the lower...
View Article`` breaks `justify-content: center` in the body tag
for some reason adding <!DOCTYPE html> breaks justify-content: center in the body tag. It's like a container without a doctype takes all the space it has, and with it only a part of it.body{...
View ArticleSplit *ngFor data into 2 columns
I have this html:<div class="w-full flex justify-center"><div *ngFor="let item of items" class="flex...
View ArticleBox-shadow issue when using Flexbox and object-fit
I want to have a container that fills the whole screen. Inside is an image aligned to the center. The image is not any specific size. I'm using a transition effect to show the image appearing from the...
View ArticleNeed to remove the gaps caused by different sizes of grid items in a grid layout
When I try to align these boxes with varied width and height, I can see empty spaces in both directions. I tried with flex and grid layouts and below is my output.My output that has horizontal and...
View ArticleHow to add icon in HTML [closed]
How can I add icons in html and CSS?I need this for my assignment , it requires icons next to the text so I tried to add the icon and watched the tutorial but I cant understand themBeforeLike this...
View ArticleFit table cell to the div inside it with flexbox
I created a "schedule calendar" on my webpage, which should display existing appointments according to the data provided in the Model from the back-end side:<table...
View ArticleMasonry Grid Not filling empty Space [duplicate]
I've been using Sveltekit and SCSS to build a Masonry grid. However in my masonry grid all the items should fill in empty space, they instead get dictated by the largest image and do not fill in any...
View ArticleLimit viewport scrolling to part of content with CSS
I like to have a line of elements (eg. inline-blocks, maybe in a flex container), that can overflow the viewport. However the first and last are dummy ones, considered as non-content, only to appear...
View Articlealign-content not working on flex items
I have a row-direction flexbox nested in a column-direction flexbox, but when I want to use align-content in the child, it doesn't work.When I replace display:flex of the parent by a display:block, it...
View ArticleImages in a flexbox don't resize if I make them links
I have a flexbox of three square images, which I want to adjust to the size of the browser window as I narrow or widen it. I've managed to do this. However, I would like each image to be a link. When I...
View Article