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.

Getting a background image to stay to the bottom right of the div

Featured Replies

Hello, this is going to sound like a really daft question, but nothing I do seems to work. Perhaps one of you gurus can enlighten me?

 

I have my "content" div, and I'm trying to get the background image to stick to the bottom right of the div, so the majority of the div has a plain background and the image is only shown in that corner. What CSS should I be using for this? The only way I have managed to do it is use margin-left and top, but if I change any of the content those variables will need changing. There must be a more dynamic way of doing this.

 

Any help would be appreciated.

 

Thanks

  • 2 weeks later...

Or to save a few bytes, you could replace 'bottom' with 100% and 'right' width 100% too ;)

 

eg:

 

div { background:url(path/to/image) 100% 100% no-repeat #fff; }

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.