background-image

The background-image CSS property sets the background image(s) of an element. Two types of images can be specified by this property: regular images (e.g. png, jpg, svg, gif, webp) or gradients.

Values of background-images

none | url() | inherit

none – no image

url() – the path to the background image

Examples

div {
    background-image: url('nameofimgae.jpg');
}

There is also possible to set data URI for the url(), for exmaple:

div {
    background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE8AAABPCAYAAACqNJiGAAAgAElEQVR4nI28d1xO....);
}

Related

Resources

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.