Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to scale background image to browser size.

Featured Replies

You know when you get sites where they have one background image that encompasses the whole screen.

 

How do you grizzly old veterans do it?

 

I found this code:

 

body{background:#000 url(i/bg-deal.jpg) no-repeat center center fixed;

-webkit-background-size: cover;

-moz-background-size: cover;

-o-background-size: cover;

background-size: cover;

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='i/bg-deal.jpg', sizingMethod='scale');

-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='i/bg-deal.jpg', sizingMethod='scale')";

}

body.bg-alt{background:#000 url(i/bg-deal.jpg) no-repeat center center fixed;

-webkit-background-size: cover;

-moz-background-size: cover;

-o-background-size: cover;

background-size: cover;

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='i/bg-deal.jpg', sizingMethod='scale');

-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='i/bg-deal.jpg', sizingMethod='scale')";

}

 

 

But it won't work in IE.

Why would you bother paying for a plugin, when the jQuery is freely available?

 

There are several options available on the link below, most of them CSS only.

 

I really wouldn't bother using jQuery for this, I think it's bad practise to use jQuery for something like this, especially when there are workable CSS-only solutions.

 

http://css-tricks.com/perfect-full-page-background-image/

  • Author

I agree with you Mike. I'd rather be using a css solution. But all the examples have slight niggles with them. Especially in IE.

 

So I went the JS route and it seems to work. Have a butchers.

 

 

Thanks for all the help Sash and Mike.

Edited by Jejune

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.