RoseanderMain Posted January 5, 2022 Posted January 5, 2022 Site URL: http://www.roseandermain.com Some of my portfolio banner images look good on desktop, but not mobile, so I'd like to be able to swap them. I have found explanations of CSS that I can add that targets a specific block ID, but not sure how to translate this idea to a handful of portfolio pages. Thanks! James
tuanphan Posted January 11, 2022 Posted January 11, 2022 You mean change to another image on mobile? Which images? We can help easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
RoseanderMain Posted January 26, 2022 Author Posted January 26, 2022 Hello Tuanphan, I found a solution that involved making two sections - one with a desktop image, and one with a mobile image - the code below instructs which section to display, based on browser width. /* RTP remove bottom banner in desktop */ @media screen and (min-width:768px) { [data-section-id="61e3062937970d62de6463e2"]{display: none;}} /* RTP remove top banner on mobile */ @media screen and (max-width:767px) { [data-section-id="619d5990f1001a58cd6cbc4e"]{display: none;}} It's a nice solution, but I needed to replicate this block for each portfolio page. In my initial question, I was hoping for a more elegant solution. But this works. Cheers! James
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment