Archived topic
Extending background to edge of page
11 replies · Started by Oisin on March 17, 2021
Hi,
If I set the background image of a div, it never stretches out to the edge of the screen, there's always padding either side.
How do I remove that padding?
Thank you.
Hi there,
can you share a link to a page where i can see the issue?
Hi Oisin,
I don't see a background image in the link you shared, could you point me to the page that contains the background image?
Let me know :)
I mean background images in divs.
The first two images on that URL are as such.
This is what I see of the URL you provided:
https://www.screencast.com/t/3Fhqu4sy
Where are the background images?
Apologies, I thought I'd set the correct home page.
Here's the page in question: https://premiumpaving.co.uk/home/
Hi there,
I've checked the link you've provided and you don't seem to have a BG image added to a background, but rather a content w/c you want to act as background.
You should add the background image as a background image of the section rather than a content if you want it to work as a background.
But if you want to keep it that way but make the image full width, you can try setting the Inner Box Type to "Full width" as well but this will make the contents full width too.
If you don't want that. You can try adding this CSS:
.local-experts-header-bg {
margin-left: calc(-100vw/2 + 100%/2);
margin-right: calc(-100vw/2 + 100%/2);
max-width: 100vw;
width: auto;
}
Hi Elvin,
Thanks, that seems to work quite well.
Is there any way to fix the horizontal scrollbar that appears when using the code above?
Thanks Elvin.
Try this CSS:
body {
overflow-x: hidden;
}
Seems to have done the trick.
Thank you.
No problem :)