CSS - Background

> (World Wide) Web - (W3|WWW) > CSS - Cascading Style Sheets - Markup Language (HTML|XML) Skin

1 - About

The background of an element is the total size of the element:

When two element overlap, you can send one element to the background by setting the z-index

Advertising

3 - Property

.backgroundWithPadding {
    background-color: SkyBlue ;
    padding: 15px;
    border: 5px solid black;
}
.backgroundWithoutPadding {
    background-color: SkyBlue ;
    border: 5px solid black;
}
.backgroundWithPaddingAndMargin {
    background-color: SkyBlue ;
    border: 5px solid black;
    padding: 5px;
    margin: 10px;
}
 
body {
    background-color: steelblue;
}
<div class="backgroundWithPadding" >
background With Padding and Without Margin
</div>
<div class="backgroundWithoutPadding" >
background Without Padding and Without Margin
</div>
<div class="backgroundWithPaddingAndMargin " >
background With Padding and Margin
</div>

web/css/background.txt ยท Last modified: 2019/02/09 11:40 by gerardnico