Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My background image doesn't fill the whole screen and gets smaller on getting the page size smaller(CTRL -)

Tags:

css

background

I'm trying to share some knowledge by posting some css tricks questions(and jquery tricks in another topics) and answer it.
Here I'm dealing with css very simple issue, background doesn't fill the whole screen(<100% width, <100% height) and when CTRL - (getting the webpage size smaller) the background image gets smaller.
For example: http://jsfiddle.net/YEksu/3

like image 273
System-x32z Avatar asked Dec 03 '25 06:12

System-x32z


1 Answers

just add background-size: cover; to the css.
Here's example: http://jsfiddle.net/YEksu/2

like image 168
System-x32z Avatar answered Dec 05 '25 23:12

System-x32z



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!