© Mikael Olsson 2019
Mikael OlssonCSS3 Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-4903-1_14

14. Background

Mikael Olsson1 
(1)
Hammarland, Finland
 

The background properties can add background effects. None of these properties inherits and they can be applied to any elements.

background-color

The color of an element’s background is set with the background-color property. By default, its value is set to transparent.
background-color : transparent | <color>
Even if a background image is used, it is a good idea to set a background color. That way, there is a fallback color in case the background image is unavailable for any reason.
background-color: #ccc;

background-image

background-image specifies an image to use as a background with the url ...

Get CSS3 Quick Syntax Reference: A Pocket Guide to the Cascading Style Sheets Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.