Background Images
A background image can be specified on almost any HTML element.
⬇ Download casino theme party - stock pictures and illustration in the best photography agency reasonable prices millions of high quality and royalty-free stock photos and images. 36 Las Vegas HD Wallpapers and Background Images. Download for free on all your devices - Computer, Smartphone, or Tablet. Computer, Smartphone, or Tablet. Wallpaper Abyss. 36 Las Vegas HD Wallpapers and Background Images. Download for free on all your devices - Computer, Smartphone, or Tablet. Casino Las Vegas.
To add a background image in HTML, use the CSS property background-image.
Background Image on a HTML element
To add a background image on an HTML element, you can use the style attribute:
Example
Add a background image on a HTML element:
You can also specify the background image in the <style>element:
Example
Specify the background image in the style element:
div {
background-image: url('img_girl.jpg');
}
</style>
Background Image on a Page
If you want the entire page to have a background image, then you must specify the background image on the <body> element:
Example
Add a background image on a HTML page:
body {
background-image: url('img_girl.jpg');
}
</style>
Background Repeat
If the background image is smaller than the element, the image will repeat itself, horizontally and vertically, until it has reach the end of the element.
To explain, see what happens when we use a small image as a background inside a large div element:
The background-image property will try to fill the div element with images until it has reach the end.
Example
body {
background-image: url('example_img_girl.jpg');
}
</style>
To avoid the background image from repeating itself, use the background-repeat property.
Example
body {
background-image: url('example_img_girl.jpg');
background-repeat: no-repeat;
}
</style>
Background Cover
If you want the background image cover the entire element, you can set the background-size property to cover.
Also, to make sure the entire element is always covered, set the background-attachment property to fixed:
As you can see, the image will cover the entire element, with no stretching, the image will keep its original proportions.
Example
body {
background-image: url('img_girl.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
</style>
Background Stretch
If you want the background image stretch to fit the entire image in the element, you can set the background-size property to 100% 100%:
Try resizing the browser window, and you will see that the image will stretch, but always cover the entire element.
Example
body {
background-image: url('img_girl.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% 100%;
}
</style>
Free Printable Casino Clip Art
Try it Yourself »Learn More CSS
Casino Pictures Images

From the examples above you have learned that background images can be styled by using the CSS background properties.
To learn more about CSS background properties, study our CSS Background Tutorial.