Archived topic
How to remove padding below image in 2 column section
9 replies · Started by Roger on November 25, 2018
I've created a full width section with 2 columns on my About page. The left column contains an image that I'd like to fill the column. However, I can't find a way to remove the padding / margin below the image which leaves the background color visible.
Grateful for advice on this one.
Hi there,
This CSS is added in Simple CSS:
.lgc-column {
padding: 10px;
}
Let me know if this helps :)
Thanks Leo. I've already removed that padding and I'm still seeing a margin /padding below the image. Any ideas?
I still see it being added:
https://www.screencast.com/t/uNTnEBLKs9Tk
Am I looking at the right section?
Ah, no. The section I'm referring to is this one: http://bit.ly/2FDKgRy
Hmm can't quite tell where is that coming from either.
What happens if you remove the <div class="my-grid-div">? Not sure why that's needed? You can add custom classes to LGC itself.
I've removed the div class and tried a bunch of variations with the css but I can't find a way to remove all padding/margins from the image in the left-hand column so that it covers 50% of the section.
Grateful for any more help on this one!
Hi there,
remove the padding CSS that Leo mentioned and add this CSS:
.inside-grid-column {
height: 100%;
}
.inside-grid-column img {
height: 100%;
widthH: 100%;
object-fit: cover;
}
Thanks David. With that help from you and Leo we've nailed it!
In summary:
Apply a custom class to the section (in the section settings):
my-class
Add this CSS to remove the padding:
.my-class .lgc-column, .my-class .generate-sections-inside-container, .my-class .inside-grid-column {
padding: 0;
}
Add your CSS (with the extra custom class):
.my-class .inside-grid-column {
height: 100%;
}
my-class .inside-grid-column img {
height: 100%;
widthH: 100%;
object-fit: cover;
}
This allows the image to fill the column in which it's inserted within a targeted section.
You're welcome from Leo and I - glad we could help