Skip to main content

Questions tagged [css-grid]

CSS grid layout is a W3C technology that allows for the creation of grids. It eliminates the need to use floats, tables, absolute positioning and even flexbox for building all sorts of grids, from simple to complex. Do not use this tag for CSS grid systems in general.

0 votes
1 answer
29 views

Tailwind: dynamic grid columns with no gaps

The documentation is not very clear about all the grid options there. I have this grid template in alpinejs styling it with tailwind: <div x-show="multiple" class="w-auto grid mt-3&...
domjanzsoo's user avatar
1 vote
4 answers
55 views

How to float elements from bottom left corner to top right corner

Is there a smart and simple way to float elements from bottom left corner to top right corner? My solution with display:grid is too static and has fix cols and not more than 10 items. I`m searching ...
Michael Koch's user avatar
1 vote
0 answers
18 views

CSS Resize grid cell based on image content

I have the following basic HTML + CSS of a grid with 2 columns and 3 rows: <div class="container"> <div class="inner-container"></div> <div class="...
Texfy's user avatar
  • 47
-1 votes
1 answer
33 views

Data table using CSS Grid and Div elements [closed]

I created a data table using CSS Grid and Div elements. Previously, I used Display Flex, but I had trouble implementing rowspan and colspan with Div elements. .grid-responsive { overflow-x: auto;...
Sandip Developer's user avatar
0 votes
2 answers
46 views

Grid Template Layout - aligning multiple items in same column (self align start)

I'm trying to use grid template to build a layout for different views (mobile / desktop etc). I'm using grid-template-area. For mobile it is easy since I'm using just 1 column but when I go to desktop ...
Mike Trinh's user avatar
  • 1,303
1 vote
3 answers
53 views

Reordering columns in CSS grid

I have the following HTML: <ul> <li> <p>A</p> <p>B</p> <p>C</p <p>D</p> </li> <li> <p>AAA</p> ...
ICR's user avatar
  • 14.1k
1 vote
1 answer
52 views

Vertical alignment by baseline in css grid doesn't work in Firefox and Safari when height is not defined

I need to arrange multiple items with pictures and titles in a row of a grid like this: The aspect ratio of the pictures is known. The amount of columns is known. The grid's width is inherited from ...
dumistoklus's user avatar
1 vote
0 answers
25 views

Translate element depending on its position in css-grid in react

I have an app component that contains a parent element, which is a css-grid container. Inside the parent, I have a couple of box elements. The layout is set up so that each box is 100px x 100px large,...
user25987386's user avatar
1 vote
1 answer
64 views

CSS sticky cards using grid layout

I want to have a layout of sticky cards using grid layout. This is what I managed to achieve: for (const cards of document.querySelectorAll(".cards")) { let i = 0; for (const card of cards....
Vivere's user avatar
  • 2,150
0 votes
0 answers
32 views

grid-auto-flow: dense not working with responsive grid layout

In my responsive two column layout, I want items to have their own height, I don't want them to share the same height of the items next to them. I'm using Tailwind, JavaScript & React. ...
Denby101's user avatar
  • 143
0 votes
2 answers
79 views

How to place a single item on a responsive grid row?

I am using a grid to place cards. The grid is responsive using minimax and auto-fit: grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); But, I would like to have a single card in the first ...
Leevi L's user avatar
  • 1,712
0 votes
1 answer
22 views

Cell in css grid overflow if align-items: end is set

When I use align-items: end in my example, the content overflows and I have no idea why. I expect the same behavior as with align-items: start. I tried setting the width but I couldn't find a solution....
jhrom's user avatar
  • 3
-2 votes
3 answers
59 views

Change background colour of certain row

I have this code and I want to change the background colour of the fifth last row. I know I need to use nth-last-child. Someone can tell me the code? .grid-container { display: grid; grid-...
michaelmichael's user avatar
0 votes
1 answer
39 views

How can I change col/row behavior based on available space?

I have a set of cards, whose have their own cards, like this (i am using TailwindCSS btw): <script src="https://cdn.tailwindcss.com"></script> <div class="grid grid-cols-3 gap-4">...
Vinicius Ortiz's user avatar
1 vote
2 answers
65 views

CSS grid/flex shrink based on content but grow evenly

I am building a Navbar for my app. I would like to have my items shrink based on their content but grow based on the average size. All I want is: if there is enough space for all items to be max-...
Tim Nikischin's user avatar

15 30 50 per page
1
2 3 4 5
419