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.

Background Images for different resolutions

Featured Replies

http://qwibbledesigns.co.uk/preview/wood/

 

In a resolution of 1024 px and below, the background appears fine, but above that the image dcdoesn'tover it all. As you might know, the background image is a largely used web dev resource, and comes in largeer resolutions. Is it possible to show a background imge depended on a persons resolution?

 

Else, how do you recommend I get round this?

You might be able to do this with javascript, but most designers would use an image that can be repeated horizontally i.e

 

<style type="text/css">
body{background:url(bg.png) top repeat-x fixed;}
</style>

 

Looking at it in my 1280*800 resolution though it looks fine...

Method 1

 

Change

background : url(../images/1280x1024.jpg) no-repeat fixed;

To

background : url(../images/1280x1024.jpg) repeat-x fixed center 0;

 

It won't stretch it, but it will repeat it to cover the blank area (which I think looks better anyway). Seems to work fine at 1650*1050 if I change to that.

 

Method 2

 

If you prefer it stretched then you have to insert it as a normal image in your HTML. Then style it using CSS using something like:

.bg_image {position:absolute;z-index:-1;top:0px;left:0px;width:100%;height:100%;}

I can't remember the last time I did this, but I'm not sure if you need to set the width and height of "body" to 100% too for it to work...

 

Both methods work, I'd go for the first one (repeating) and there's no need for JavaScript or anything! Just basic CSS and HTML.

  • Author

Thanks peeps =)

 

I'll play around and see what I like best.

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.