I have a container which has 3 Columns. The first 3 columns can have same background colour But I want the 4th column to have a green background colour.
/* Target the 4th column in the container and set its background color to green */
.changecolourofcontainer [data-testid="cc-column"]:nth-child(4) {
background-color: green; /* Change background color to green */
}
/* Target the 4th wire-container and set its background color to green */
.changecolourofcontainer [data-testid="wire-container"]:nth-child(4) {
background-color: green; /* Change background color to green */
}
/* Target the last column using its unique ID */
#must-start-with-a-letterffde33742300cdc71e1f09aa0281ccd4 {
background-color: #e8f5e9 !important; /* Light green background */
padding: 20px;
border-radius: 8px; /* Optional rounded corners */
}
and got it to apply to one element in the last column. But now able to get it to entire column.
Ah of course! The container CSS class applies at a higher level so my first response wouldn’t work.
What I would suggest is assigning the container a class in the custom css field (ive called mine test-class for now), then inspect the page to find out the lowest level component that has all the containers components, which for me looks like .idNmRo. In other words, the html element that has the separate container columns as its children, I’ve attached a screenshot which hopefully makes that make more sense.
The behavior of this container will switch between a 4x1 column, 2x2 columns, and 1x4 columns depending on the screen size. I’d like to know what you expect when dealing with a smaller screen—would you prefer to maintain the 4-column layout or not?
This code applies in all situations, except since the addition of :not(:has(.mobile-layer)), the block of this code no longer applies on mobile. You can remove it, which will result in having 4 columns on mobile as well (not recommended for smaller screen widths).
Here, I am only applying a container layout of 4 x 1 and 1 x 4 (for mobile).
If you want to use the container layout according to the default CSS from Glide, then just remove this property: grid-template-columns: repeat(3, 1fr) 2fr;.