#background image not covering the whole page

10 messages · Page 1 of 1 (latest)

gentle aurora
#

Hello guys i am working kevin powell frontend mentor challenge space travel page
I am facing this issue

https://github.com/tanu-12/space_travel_page

inside it you will find index.html and index.css . when i add the background image to desktop view it leaves a padding on the right hand side . i don't know why the background image is not covering everything

GitHub

Contribute to tanu-12/space_travel_page development by creating an account on GitHub.

dense parrot
#

hey @gentle aurora a combination of these rules is probably what you are looking for
background-size: cover
background-size: contain
background-repeat: no-repeat

#

probably the first one will do, but perhaps you'll also find the rest of them useful

gentle aurora
#

Should i apply it to home class

dense parrot
#

to the class that has the background

lusty whale
#

The background shortcut is wiping out the size so just add background-size: cover to the 2 .home definitions inside the media queries.

gentle aurora
#

Ok will try

lusty whale
#

alternatively use background-image instead of background - this will prevent your other settings from being overwritten by defaults...

gentle aurora
#

Thanks

#

Using both background-image and background-size:cover in my media queries for desktop did the trick