Grid column responsive width but no more and no less than

Hyster

I would like to have a css grid with cards, that are responsive and can grow and shrink as in these pictures: small screen - two columns

larger screen - three columns

So for this reason I have used minmax css function:

grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));

However, if there are no more cards in list to be put in a single row, the existing cards grow to the limits of parent:

only 2 cards - grow indefinitely

How can I give an upper limit for the minmax function?

m_sultan

Replace repeat(auto-fit, minmax(300px, 1fr)) with repeat(auto-fill, minmax(300px, 1fr))

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

jQuery - test if img width is 'more than' and 'less than'

分類Dev

Is `tail -f` more efficient than `less +F`?

分類Dev

Fetch more than one column

分類Dev

How to construct a responsive grid of DIVs that all have the same width

分類Dev

ImageView width more than cell width in UITableView Cell - XCode 6

分類Dev

@media not working with width less than 1024px

分類Dev

Uwp cannot lower the width of textbox to less than 70

分類Dev

Increase width of column in ui.grid

分類Dev

Setting Column Width with restructuredText Grid Tables

分類Dev

keep column width using responsive table bootstrap3

分類Dev

Set google maps InfoWindow to more than 700px width

分類Dev

angularjs: ui-grid not renders more than 10 columns

分類Dev

Is there a more concise method to filter columns containing a number greater than or less than, in dplyr?

分類Dev

Find where column matches more than one in another column

分類Dev

Xamarin Forms - Get Image to Fill width of containing Grid Column?

分類Dev

How do I make an if statement not execute and go to the else if statement if one or more variables are less than 0?

分類Dev

Spark Window function using more than one column

分類Dev

Spark Window function using more than one column

分類Dev

Find SUM of child table column is less than parent child total column

分類Dev

Svg responsive width with adjustable height

分類Dev

Filter and save in-place, lines with value less than or equal ≤‎X in a specific column and with header

分類Dev

Responsive Grid with Borders on the Inside Only

分類Dev

Two column responsive issue

分類Dev

How to force a fixed column width with a Bootstrap grid and keep the other ones fluid

分類Dev

How to force a fixed column width with a Bootstrap grid and keep the other ones fluid

分類Dev

How to force a fixed column width with a Bootstrap grid and keep the other ones fluid

分類Dev

less or more - which to use when?

分類Dev

how can i remove entire row if a column has more than 10 characters using pandas

分類Dev

Pandas KeyError while adding more than one column from another DataFrame

Related 関連記事

  1. 1

    jQuery - test if img width is 'more than' and 'less than'

  2. 2

    Is `tail -f` more efficient than `less +F`?

  3. 3

    Fetch more than one column

  4. 4

    How to construct a responsive grid of DIVs that all have the same width

  5. 5

    ImageView width more than cell width in UITableView Cell - XCode 6

  6. 6

    @media not working with width less than 1024px

  7. 7

    Uwp cannot lower the width of textbox to less than 70

  8. 8

    Increase width of column in ui.grid

  9. 9

    Setting Column Width with restructuredText Grid Tables

  10. 10

    keep column width using responsive table bootstrap3

  11. 11

    Set google maps InfoWindow to more than 700px width

  12. 12

    angularjs: ui-grid not renders more than 10 columns

  13. 13

    Is there a more concise method to filter columns containing a number greater than or less than, in dplyr?

  14. 14

    Find where column matches more than one in another column

  15. 15

    Xamarin Forms - Get Image to Fill width of containing Grid Column?

  16. 16

    How do I make an if statement not execute and go to the else if statement if one or more variables are less than 0?

  17. 17

    Spark Window function using more than one column

  18. 18

    Spark Window function using more than one column

  19. 19

    Find SUM of child table column is less than parent child total column

  20. 20

    Svg responsive width with adjustable height

  21. 21

    Filter and save in-place, lines with value less than or equal ≤‎X in a specific column and with header

  22. 22

    Responsive Grid with Borders on the Inside Only

  23. 23

    Two column responsive issue

  24. 24

    How to force a fixed column width with a Bootstrap grid and keep the other ones fluid

  25. 25

    How to force a fixed column width with a Bootstrap grid and keep the other ones fluid

  26. 26

    How to force a fixed column width with a Bootstrap grid and keep the other ones fluid

  27. 27

    less or more - which to use when?

  28. 28

    how can i remove entire row if a column has more than 10 characters using pandas

  29. 29

    Pandas KeyError while adding more than one column from another DataFrame

ホットタグ

アーカイブ