basscss-addons
Version:
Optional modules to extend Basscss
58 lines (40 loc) • 1.5 kB
Markdown
This module controls background size and position for background images.
## Background Size
Use the `.bg-cover` or `.bg-contain` utilities to control background size.
```html
<div class="p4 bg-cover white bg-gray" style="background-image: url(https://d262ilb51hltx0.cloudfront.net/max/2000/1*DZwdGMaeu-rvTroJYui6Uw.jpeg)">
<h1>.bg-cover</h1>
</div>
```
## Background Position
Use background position utilities to control position.
### .bg-center
```html
<div class="p4 bg-cover bg-center white bg-gray" style="background-image: url(https://d262ilb51hltx0.cloudfront.net/max/2000/1*DZwdGMaeu-rvTroJYui6Uw.jpeg)">
<h1>.bg-center</h1>
</div>
```
### .bg-top
```html
<div class="p4 bg-cover bg-top white bg-gray" style="background-image: url(https://d262ilb51hltx0.cloudfront.net/max/2000/1*DZwdGMaeu-rvTroJYui6Uw.jpeg)">
<h1>.bg-top</h1>
</div>
```
### .bg-right
```html
<div class="p4 bg-cover bg-right white bg-gray" style="background-image: url(https://d262ilb51hltx0.cloudfront.net/max/2000/1*DZwdGMaeu-rvTroJYui6Uw.jpeg)">
<h1>.bg-right</h1>
</div>
```
### .bg-bottom
```html
<div class="p4 bg-cover bg-bottom white bg-gray" style="background-image: url(https://d262ilb51hltx0.cloudfront.net/max/2000/1*DZwdGMaeu-rvTroJYui6Uw.jpeg)">
<h1>.bg-bottom</h1>
</div>
```
### .bg-left
```html
<div class="p4 bg-cover bg-left white bg-gray" style="background-image: url(https://d262ilb51hltx0.cloudfront.net/max/2000/1*DZwdGMaeu-rvTroJYui6Uw.jpeg)">
<h1>.bg-left</h1>
</div>
```