background-size
In this chapter you will learn:
background-size
You can specify percentages and pre-defined values for background-image size. The size is then derived from the width and height of the image.
The background-size Values:
Value | Description |
---|---|
contain | Scales the image, preserving the aspect ratio, to the largest size that can fit. |
cover | Scales the image, preserving the aspect ratio, to the smallest size that can fit. |
auto | Display the image at full size(default). |
Set background image size to contain:
HyperText Markup Language (HTML) is the main markup language for displaying web pages and other information that can be displayed in a web browser(From From Wikipedia, the free encyclopedia).
background image to cover
Set background image size to cover:
HyperText Markup Language (HTML) is the main markup language for displaying web pages and other information that can be displayed in a web browser(From From Wikipedia, the free encyclopedia).
Next chapter...
What you will learn in the next chapter:
- Definition, default value, CSS version and JavaScript syntax for border
- Syntax to create border property and meaning for each of its property value
- An example showing how to use border CSS property
- How to add a black thick solid border