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.

Bootstrap responsive background image

Featured Replies

I have a design that I'm converting to be Bootstrap responsive but have run into a couple of problems.


  1. How to make a non full width background image responsive
  2. How to keep the main form content the correct distance away from the top of the image no matter what the viewport size.

Mock up image


Website


Js Fiddle - http://jsfiddle.net/handcoded/nsaoxbez/1/


I'd be very grateful for any pointers


Hi!
If I have a smaller image, eg.: 960px wide, I would place it to the middle for wider screens, and for smaller ones, I would use the background-size property.
http://www.w3schools.com/cssref/css3_pr_background-size.asp

With 480px or smaller the background image can be different, with only a gradient or with one color, with that small size I would focus on usabilty, make text readable etc.

If you want to keep the content in a certain distence from the top, that is not a problem, vertical (top or bottom) padding or margin will not changif you set it in pixels not percent, only horizontal distanses cause problems.

I would use Background-size: cover;

 

If you add this to your jsFiddle it should show you what you are after.

body {
    Background-size: cover;
}

Edited by richardmountain

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.