Full-width Background Color with Padding in CSS


Extend background colors full width while keeping content constrained with padding and negative margins.

Source Code

.full-width-background {
    padding: 20px;
    margin: 0 -20px;
    background-color: #eee;
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments