Why isn’t the image full width?
-
First of all, I wish you a happy new year.
I’m redesigning the website. It’s not complete yet, but I’m stuck on a problem with the image width. I’m adjusting it using this code.
const scrollTop = window.scrollY;
if (window.location.pathname === '/') {
const element = document.querySelector('#tlacitko img');
const position = element.getBoundingClientRect();
if (scrollTop === 0) {
$("#tlacitko img").css({
position: 'relative',
left: -position.left,
top: -position.top,
zIndex: "5",
width: "1920px"
});
} else {
$("#tlacitko img").css({
position: 'relative',
zIndex: "5",
left: -position.left,
top: "-110px",
width: "1920px"
});
}
}If I put the position absolute, the page falls apart, so I used relative.
Even though I managed to position it correctly in the upper left corner, there’s still a gap on the right.
The problem is because the template has padding-left and padding-right, which results in that gap.
Is there a way to fix this? Setting the padding to 0 for the images has no effect.
Please help
Thank you
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.