Jump to content

CSS shorthand Error


Oladunni Faith
 Share

Recommended Posts

I"m new to the world of coding and  recently just started learning Css so i tried practicing css shorthand with the aim of making the background image cover the entire screen but it isn't working..... can someone please help me on this?

Screenshot (39).png

Screenshot (38).png

Edited by Oladunni Faith
Link to comment
Share on other sites

first of all, NEVER use spaces in file names, use alternative of hyphen '-' or underscore '_', as in practise-css.html oor practise_css.html. secondary, this should be done on web server, WAMP for example not your computer filesystem.

I would imagine the problem is you have no content in body, so the height is 0, so the background image has no area to show. Try setting body and html elements to min-height: 100vh;

Link to comment
Share on other sites

well yeah, left, right, top etc would give the same result, because cover fills the whole parent container, BUT! if you used 'contain' instead the result would represent what you used for portrait align left or right, landscape top or bottom.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...