How do I make a cover block on desktop but not on mobile?
-
I’m looking for “How to” support rather than fixing something broken, so I hope this is a reasonable place for this post. So much has changed with WordPress 6, and I’m very new here, but trying to learn. I have read (but unsure how much I truly understand) about using PHP and CSS to present different formatting on desktop vs mobile, but it all seems to be written for classic themes rather than block themes.
I’m using WordPress 6 with a modified Twenty Twenty-Two theme installed offline via “Local by Flywheel.” I want to have a background for pages on desktop and have customized a template using a “Cover” block as the first element. The rest of the page is built in the group within the cover block. However, on mobile (phones) I would like to allow the group within the “Cover” block to be displayed full width – I think essentially ignoring the padding of the cover.
Is it possible to assign a custom CSS class to the cover element and use @media to remove the cover padding below a certain threshold viewport width? I feel like I’m so close – but I may be totally off base and would appreciate some guidance.
Thank you,
taw
- The topic ‘How do I make a cover block on desktop but not on mobile?’ is closed to new replies.