Using multiple CSS background images

It isn’t something developers have a need to do very often, but you can set multiple background images on a single element.

Example:

.element {
background: url(‘image_path’) center repeat, linear-gradient(transparent 0%, #000 100%) no-repeat;
}


This content originally appeared on Ugly Duck and was authored by Bradley Taunt

It isn’t something developers have a need to do very often, but you can set multiple background images on a single element.

Example:

.element {
    background: url('image_path') center repeat, linear-gradient(transparent 0%, #000 100%) no-repeat;
}

What can you do with this? It’s only limited by your imagination, but I’m personally a fan of always using as few elements as possible when working on a project.


This content originally appeared on Ugly Duck and was authored by Bradley Taunt


Print Share Comment Cite Upload Translate Updates
APA

Bradley Taunt | Sciencx (2018-08-28T00:00:00+00:00) Using multiple CSS background images. Retrieved from https://www.scien.cx/2018/08/28/using-multiple-css-background-images/

MLA
" » Using multiple CSS background images." Bradley Taunt | Sciencx - Tuesday August 28, 2018, https://www.scien.cx/2018/08/28/using-multiple-css-background-images/
HARVARD
Bradley Taunt | Sciencx Tuesday August 28, 2018 » Using multiple CSS background images., viewed ,<https://www.scien.cx/2018/08/28/using-multiple-css-background-images/>
VANCOUVER
Bradley Taunt | Sciencx - » Using multiple CSS background images. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2018/08/28/using-multiple-css-background-images/
CHICAGO
" » Using multiple CSS background images." Bradley Taunt | Sciencx - Accessed . https://www.scien.cx/2018/08/28/using-multiple-css-background-images/
IEEE
" » Using multiple CSS background images." Bradley Taunt | Sciencx [Online]. Available: https://www.scien.cx/2018/08/28/using-multiple-css-background-images/. [Accessed: ]
rf:citation
» Using multiple CSS background images | Bradley Taunt | Sciencx | https://www.scien.cx/2018/08/28/using-multiple-css-background-images/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.