Archived topic
Disable cover on mobile
5 replies · Started by Edwin on February 3, 2020
Hi
What is the best way to disable Cover for Page hero on the mobile
The below is working, but is not correct CSS
.page-hero {
background-size:none!important;
}
Thanks
Edwin
Hi there,
Can you explain a bit more? What do you mean by disabling Cover for page hero?
Like removing the background image on mobile?
A link to your site might also help.
Let me know :)
Hi Leo
I would like to show to picture normal in full width and height. Not cover size on mobile
Hmm background images don't quite work like this.
background-size: none isn't actually a valid property:
https://www.w3schools.com/cssref/css3_pr_background-size.asp
Can you try modifying the padding with mobile toggle activated to see if you are able to achieve the desired result?
https://docs.generatepress.com/article/how-to-create-a-page-hero/#step-4-set-the-height
We can also use an image specifically for mobile if you'd like?
Hi Leo
Hmm background images don’t quite work like this.
Yes, i am looking for another way. Unfortunately, i have many headers in the website and only that seems to work. Padding will now work, it will not show the whole picture.
Every case is a bit different as it really depends on the picture itself.
One thing for sure is that background-size: none; isn't fixing anything as it's an invalid command.
Can you try adding that image as the featured image of that page and make it displayed in the header element?
Then we can try hiding the page hero on mobile and just use the featured image instead.
Let me know :)