background-image - CSS: Cascading Style Sheets | MDN - MDN …
- 123
The background-image property in CSS is used to set one or more background images for an element. This property can be applied to any HTML element.
Example
body {background-image: url('background.jpg');}This example sets a background image for the entire page1.
Multiple Background Images
You can also set multiple background images by separating them with commas.
body {background-image: url('image1.png'), url('image2.png');}In this example, image1.png will be layered on top of image2.png2.
Gradients as Background Images
CSS allows you to use gradients as background images.
body {background-image: linear-gradient(to right, red, yellow);}This example creates a linear gradient from red to yellow3.
Fallback Color
Always specify a fallback color in case the image fails to load.
body {background: url('background.jpg') blue;}In this example, if the image fails to load, the background color will be blue3.
CSS background-image Property - W3Schools
Tags:CSS Background-ImageCascading Style Sheetsno. Read about animatableBackground-image - CSS-Tricks
Feb 17, 2015 · Learn how to use background-image to apply graphics or gradients to the background of an element. See examples of regular images, data URIs, sprites, multiple backgrounds, and more.
Tags:CSS Background-ImageCascading Style SheetsBackground Css Propertybackground - CSS: Cascading Style Sheets | MDN - MDN Web Docs
Tags:Cascading Style SheetsBackground Css PropertyWeb BackgroundHTML Background Images - W3Schools
Tags:CSS Background-ImageBackground Css PropertyHTML Background ImagesHow to Add Background Image with CSS - W3docs
Learn how to use CSS properties to add, position, repeat, size and opacity background images in HTML documents. See examples, code snippets and live demos.
Tags:CSS Background-ImageCss Background ImageHTML Background ImagesBackgrounds - web.dev
Tags:CSS Background-ImageBackground Css PropertyCss Background ImageCSS Background Image – With HTML Example Code
Jul 21, 2021 · Learn how to add, position, resize, repeat, and attach background images to HTML elements using CSS properties. See examples, syntax, and code snippets for different effects and scenarios.
Tags:CSS Background-ImageCss Background ImageCSS background-image Property - W3docs
Learn how to use the CSS background-image property to add images, gradients or patterns to elements. See syntax, values, examples and browser support.
Tags:CSS Background-ImageBackground Css PropertyCascading Style Sheets- Some results have been removed