Good morning Weweb community!
I have a column component (listings) displaying my listing (listing) two-by-two on each row. I want to control the padding according to the listing position.
I’m looking to sets for each first item a
padding-left: 0px; padding-right: 10px;
and for each second item
padding-left: 10px; padding-right: 0px;
Assuming we are using a collection-based structure, it’s not possible to control the listing behavior independently.
I tried the following approach using odd and even below :
/* Set padding for the first item in each row */
.listings .listing:nth-child(even) {
padding-left: 0px;
padding-right: 10px;a
}
/* Set padding for the second item in each row */
.listings .listing:nth-child(odd) {
padding-left: 10px;
padding-right: 0px;
}
I copied the snippet on the custom CSS editor (right side panel) of the listing element before pushing it live, but unfortunately, nothing changed.
Also, when I copied the snippet into the custom CSS editor if a clicked somewhere else and I return into the custom CSS editor, the code appears to be completely destroyed
custom CSS editor after click
I would appreciate a little bit of advice on this use case please
Thank you !
Listings component
Listing item