Shopify themes, liquid, logos, and UX
Hi, my images on the section stated: Loved By Over 5,000 Aussies ⭐️⭐️⭐️⭐️⭐️
https://silksoothehair.com/products/silksoothe%E2%84%A2-premium-red-light-massage-brush
looks good on mobile, but on web I would like it to be rectangular. Like this:
How can I make desktop different and only desktop? Thanks!
Hey @caitlynneal ,
To make the image rectangular on desktop only, you can use CSS media queries to apply different styles based on the screen size. Here’s how you can achieve that:
Here’s an example CSS code snippet:
/* Default styling for mobile */
.image-class {
width: 100%;
aspect-ratio: 1/1; /* Keeps it square */
}
/* Styling for desktop */
@media (min-width: 768px) {
.image-class {
width: 100%;
aspect-ratio: 4/3; /* Adjust this to make it rectangular */
}
}
Replace .image-class with the actual class name of your image. This approach ensures that the image remains square on mobile and becomes rectangular on desktop. Adjust the aspect-ratio value as needed for your preferred rectangular shape on desktop.
Let me know if you need further assistance applying this!
If I was able to help you, please don't forget to Like and mark it as the Solution!
Best Regard,
Rajat Sharma
Apologies for the confusion, i want to make the image rectangular on both phone and web! @rajweb
No problem! To make the image rectangular on both desktop and mobile, you can set a fixed aspect ratio for the image. Here's how you can do it:
.image-class {
width: 100%;
aspect-ratio: 4 / 3; /* Adjust the aspect ratio to make it rectangular */
object-fit: cover; /* Ensures the image covers the area without stretching */
}
With this, your image will appear rectangular across all devices. Let me know if this helps or if you have further adjustments in mind!
If you’re still facing issues, please message me via email, and we can discuss it further.
thanks
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024