O
O
Oleg Volodin2013-11-26 14:28:50
css
Oleg Volodin, 2013-11-26 14:28:50

How to make the background fill the entire screen of the document?

Guys, tell me how to make the background fill the entire screen of the document. Those. Do you have an image that needs to be stretched across the entire document?
PS
And tell me how to more or less competently cut a picture for such a background.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikita Gulyaev, 2013-11-26
@drondo

background-size: [ <value> | <interest> | auto ]{1,2} | cover | contain
<value> - Sets the size in any units available for CSS - pixels (px), centimeters (cm), em, etc.
<percentage> - Sets the size of the background image as a percentage of the width or height of the element.
auto - If both width and height are specified (auto auto), background dimensions remain original; if only for one side of the picture (100px auto), then the size is calculated automatically based on the proportions of the picture.
cover - Scales the image proportionally so that its width or height equals the width or height of the box.
contain - Scales the image while maintaining aspect ratio so that the entire image fits inside the block.

N
Nazar Mokrinsky, 2013-11-26
@nazarpc

If you have questions like this, go to htmlbook.ru, and see everything that starts with background in the CSS reference section.
This will save time for both you and us.

J
JakBack, 2014-12-06
@JakBack

Thank you!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question