Comments on: How to Make a Media Query-less responsive Card Component https://css-tricks.com/how-to-make-a-media-query-less-card-component/ Tips, Tricks, and Techniques on using Cascading Style Sheets. Fri, 02 Dec 2022 20:46:18 +0000 hourly 1 https://wordpress.org/?v=6.1.1 By: Geoffrey Crofte https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1797928 Fri, 02 Dec 2022 20:46:18 +0000 https://css-tricks.com/?p=319736#comment-1797928 In reply to RAKESH.

Hi Rakesh,
You should try using CSS Grid Layout for this kind of need. Look for it on CSS Tricks.

]]>
By: RAKESH https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1768044 Wed, 03 Feb 2021 06:13:36 +0000 https://css-tricks.com/?p=319736#comment-1768044 how wrap a columns
1 2 3
4 5 6
in mobile view it should be like this
1 2
4 5
3 6

]]>
By: Geoffrey Crofte https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1765355 Tue, 24 Nov 2020 18:03:28 +0000 https://css-tricks.com/?p=319736#comment-1765355 In reply to Miloš Kroulík.

Hello Miloš,
I can’t really answer for sure without an extract of your code, because even HTML could impact the behavior here. Indeed, if you didn’t put width and height attribute on the image, the rendering could vary.
Important note as well: I didn’t put much effort in the image ratio, you might need to tweak the CSS a little bit if the first HTML solution doesn’t work.
Have fun :)

]]>
By: Miloš Kroulík https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1765308 Mon, 23 Nov 2020 18:11:23 +0000 https://css-tricks.com/?p=319736#comment-1765308 Nice solution, thanks. However, I have an issue with my implementation, with styling directly transferred from your first solution – image is not fully covering its region, when I don’t specify width and height of .pizza-box as 100% – it looks like max-width and max-height are doing nothing. Do you know, what might cause this behavior?

]]>
By: Geoffrey Crofte https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1763718 Tue, 06 Oct 2020 18:00:33 +0000 https://css-tricks.com/?p=319736#comment-1763718 In reply to Rita Karath.

Hello Rita,
Sorry that you still have to support IE10 and IE11. I would say that it is a corporation decision not a CSS decision here, but I won’t risk myself on that path.
You can use @supports to use the solution I propose and override a solution for IE based on floating elements. We used to adopt a technique for responsive emails with floating tables, it should work for any kind of element. Another solution is to rely on JavaScript to define a precise behavior based on the component parent.

Unfortunately there is no magic solution when you try to answer modern issues with old and unsecure tools.

]]>
By: Rita Karath https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1763711 Tue, 06 Oct 2020 14:04:56 +0000 https://css-tricks.com/?p=319736#comment-1763711 And what about IE. Most corporations use Windows and quite a few users and corporations still use IE10 or IE11 and this won’t work.

I have built media-query-less cards and pages, but it does me no good if it won’t work for half of the people I’m trying to reach.

It’s certainly no picnic having to produce the css to work for both and I’m still in the process of trying to get it to work.

]]>
By: Geoffrey Crofte https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1762584 Fri, 11 Sep 2020 08:42:11 +0000 https://css-tricks.com/?p=319736#comment-1762584 In reply to Bobby Bottleservice.

Hello Bobby,
Thanks for your concern on accessibility! I agree the vw shouldn’t be used as is.
That’s why I used a clamp() function to make it more flexible and “zoom-friendly”. I wasn’t sure, but with both max and min at a em unit, the font is made compatible with user font-size settings. Just tested it on Chrome and Firefox with text-zoom and interface-zoom. All good

]]>
By: Bobby Bottleservice https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1762547 Thu, 10 Sep 2020 13:56:11 +0000 https://css-tricks.com/?p=319736#comment-1762547

Scalable typography is commonly done with the viewport width (vw) unit, based on the viewport

…and NOT accessible. It’s not based on the user’s browsers text size, or any other custom settings. Please avoid using it.

]]>
By: Geoffrey Crofte https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1762523 Wed, 09 Sep 2020 20:21:20 +0000 https://css-tricks.com/?p=319736#comment-1762523 In reply to Chris.

Hello Chris :)
Thanks for the feedback!

]]>
By: Geoffrey Crofte https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1762522 Wed, 09 Sep 2020 20:20:32 +0000 https://css-tricks.com/?p=319736#comment-1762522 In reply to Sam.

I can’t be more agree here Sam

]]>
By: Geoffrey Crofte https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1762521 Wed, 09 Sep 2020 20:19:58 +0000 https://css-tricks.com/?p=319736#comment-1762521 In reply to #amazing Jeremias Janowski.

Your are very welcome

]]>
By: Sam https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1762501 Wed, 09 Sep 2020 07:21:53 +0000 https://css-tricks.com/?p=319736#comment-1762501 Whenever I think about this technique I can’t help but wish there was a way (in CSS) to query the visual relationship of an element to the one preceding it. So you could say if .recipe-content is inline with .pizza-box do this. Or if .recipe-content (visually) has a block relationship with .pizza-box apply these styles. That feels quite CSSy, and would be really powerful.

]]>
By: #amazing Jeremias Janowski https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1762281 Wed, 02 Sep 2020 21:25:48 +0000 https://css-tricks.com/?p=319736#comment-1762281 Thanks for the Pizza recipe

]]>
By: Shane https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1762268 Wed, 02 Sep 2020 08:48:12 +0000 https://css-tricks.com/?p=319736#comment-1762268 Love This

]]>
By: Muhammad Rehan Saeed https://css-tricks.com/how-to-make-a-media-query-less-card-component/#comment-1762267 Wed, 02 Sep 2020 08:40:01 +0000 https://css-tricks.com/?p=319736#comment-1762267 Can this also be done with CSS Grid?

]]>