CSS - Background

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

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>


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap