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 image in a div

Featured Replies

I want a little image in the bottom right corner of a div. I've tried

 

.backgroundimage {
background-attachment: fixed;
background-image: url(images/test.jpg);
background-repeat: no-repeat;
background-position:bottom right;
height: 110px;
width: 101px;
position:relative;
top: 0px;
visibility: visible;
left: 0px;
}

 

and put

 

<div class="backgroundimage"></div>

 

It creates the space for the image, but won't display it. What's going wrong?

 

Thanks, James.

Failing that make sure

 

images/test.jpg is the correct path.

 

IS your images folder in the same folder of your css file? (the filepaths are relative to the css, not the html file).

  • Author

It still doesn't like it :mellow:

 

I put   and still nothing.

 

Checked the URL and it's valid etc, and I can't see anything else that would be stopping it from showing.

 

EDIT: Never mind got it to work.. seemed to be the element background-attachment: fixed; that was stopping it from displaying...

 

Thanks guys

  • Author

The path was also wrong in addition to the dodgy element ^_^ bocaj.

 

Ok so it's displaying now, but it doesn't want to position how I tell it to...

 

.background {
background-image: url(../images/test.jpg);
background-position: bottom right;
background-repeat: no-repeat;
height: 110px;
width: 111px;
position: relative;
visibility: visible;
top: 0px;
left: 0px;
}

 

Gah

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.