Delta Posted April 27, 2023 Share Posted April 27, 2023 Oh this site, https://www.zodiachacks.com/discover/signs/taurus, we have a mobile version of this card (the orange one) that should only be loaded on mobile - does anyone have a code or solution to block the desktop and only load the mobile in CSS? Link to comment
abibacon Posted April 27, 2023 Share Posted April 27, 2023 Hey @Delta, you can use the below CSS to hide an element on desktop, you'll need to replace '#block-id' with that of your block, and can adjust the 768px value to your liking.  // Hide On Desktop @media only screen and (min-width: 768px) { #block-id { display: none; }  Squarespace Developer based in Hampshire, England If you'd like to make a contribution for my time you can Buy Me A Coffee. Reach out for Custom Coding - abibacon.com Developer & Support Specialist at will-myers.com (Affiliate Link) Link to comment
Delta Posted April 27, 2023 Author Share Posted April 27, 2023 Thank you! This worked, I've moved the 'display: none;' property inside the media query and fixed the comment syntax to be appropriate for CSS. 😉 // Hide On Desktop @media only screen and (min-width: 768px) {  #block-id {   display: none;  } } Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment