Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background image fill up/down in CSS [duplicate]

Tags:

css

there is this background-image i have in my div element and I want it to "fill" upwards/downwards and cover its entire height and width. Please explain me how this is possible with CSS. Any help is greatly appreciated.Thanks in advance.

like image 719
stranger Avatar asked Jun 19 '14 07:06

stranger


People also ask

How do I repeat a background image in CSS vertically?

The background-repeat property in CSS is used to repeat the background image both horizontally and vertically. It also decides whether the background-image will be repeated or not. Background-repeat: This property is used to repeat the background image both horizontally and vertically.

How do I repeat a background image twice in CSS?

The background-repeat property sets if/how a background image will be repeated. By default, a background-image is repeated both vertically and horizontally. Tip: The background image is placed according to the background-position property.

How do I make my background image not repeat CSS?

If you want the background image not to repeat at all, use background-repeat: no-repeat; .


1 Answers

-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;

Documentation from CSS Tricks: http://css-tricks.com/perfect-full-page-background-image/

like image 101
wildandjam Avatar answered Nov 15 '22 10:11

wildandjam