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 Image - Full Page Background Image

Featured Replies

Hi folks

 

I am trying to get the latest website of mine up and running,however I am having a small problem trying to get it working

 

I am using boostrap v3.0

 

I have a simple imageas the background, I am wanting it to be a full page, and I have decided to make it responsive using the boostrap css class responsive image. Now for some reason no matter what I do the the picture never seems to display correctly, there is always a scroll bar on the right hand side, in order to view the whole image you need to scroll down. I am using the image size of 1366x768, Can anyone suggest any fixes as I cant seem to get my head around this.

 

the domain is www.kaynescooters.com if you would like to see the problem.

 

Cheers

 

tintin102

 

 

 

tht class for bootstrap will not work for background images

 

you can simply use diff size images for different browsers

 

just find the media queries in ur bootstrap main css and add separate background image of varying resolution and size

 

* Smartphones (portrait and landscape) ----------- */
@media only screen 
and (min-device-width : 320px) 
and (max-device-width : 480px) {
/* Styles */
body {background-image:url('paper9.gif');
}

/* Smartphones (landscape) ----------- */
@media only screen 
and (min-width : 321px) {
/* Styles */
body {background-image:url('paper8.gif');
}

/* Smartphones (portrait) ----------- */
@media only screen 
and (max-width : 320px) {
/* Styles */
body {background-image:url('paper7.gif');
}

/* iPads (portrait and landscape) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) {
/* Styles */
body {background-image:url('paper6.gif');
}

/* iPads (landscape) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : landscape) {
/* Styles */
body {background-image:url('paper5.gif');
}

/* iPads (portrait) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : portrait) {
/* Styles */
body {background-image:url('paper4.gif');
}

/* Desktops and laptops ----------- */
@media only screen 
and (min-width : 1224px) {
/* Styles */
body {background-image:url('paper.gif');
}

/* Large screens ----------- */
@media only screen 
and (min-width : 1824px) {
/* Styles */
body {background-image:url('paper2.gif');
}

/* iPhone 4 ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
/* Styles */
body {background-image:url('paper3.gif');
}

Edited by sash_oo7

  • Author

Thanks for that info, I have taken a look at the css and I can find the following code, however I am not sure if it is the correct ones, as on the boostrap website it has slightly different dimensions. It seems to imply on there that there is an individual file just for media queries.

 

http://getbootstrap.com/2.3.2/scaffolding.html

 

@media (max-width: 767px) {
  .visible-sm.visible-xs {
    display: block !important;
  }
  tr.visible-sm.visible-xs {
    display: table-row !important;
  }
  th.visible-sm.visible-xs,
  td.visible-sm.visible-xs {
    display: table-cell !important;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .visible-sm {
    display: block !important;
  }
  tr.visible-sm {
    display: table-row !important;
  }
  th.visible-sm,
  td.visible-sm {
    display: table-cell !important;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .visible-sm.visible-md {
    display: block !important;
  }
  tr.visible-sm.visible-md {
    display: table-row !important;
  }
  th.visible-sm.visible-md,
  td.visible-sm.visible-md {
    display: table-cell !important;
  }
}

@media (min-width: 1200px) {
  .visible-sm.visible-lg {
    display: block !important;
  }
  tr.visible-sm.visible-lg {
    display: table-row !important;
  }
  th.visible-sm.visible-lg,
  td.visible-sm.visible-lg {
    display: table-cell !important;
  }
}

.visible-md {
  display: none !important;
}

tr.visible-md {
  display: none !important;
}

th.visible-md,
td.visible-md {
  display: none !important;
}

@media (max-width: 767px) {
  .visible-md.visible-xs {
    display: block !important;
  }
  tr.visible-md.visible-xs {
    display: table-row !important;
  }
  th.visible-md.visible-xs,
  td.visible-md.visible-xs {
    display: table-cell !important;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .visible-md.visible-sm {
    display: block !important;
  }
  tr.visible-md.visible-sm {
    display: table-row !important;
  }
  th.visible-md.visible-sm,
  td.visible-md.visible-sm {
    display: table-cell !important;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .visible-md {
    display: block !important;
  }
  tr.visible-md {
    display: table-row !important;
  }
  th.visible-md,
  td.visible-md {
    display: table-cell !important;
  }
}

Edited by tintin102

ya its there just target one set of each dimension for example

 

@media (min-width: 1200px) {


  .container {
max-width: 730px;}/* change this accordingly */
body{background:url('../../img/body_bg.png') no-repeat;}/* change this accordingly */

  
}

@media (min-width: 992px) {

  .container {
max-width: 730px; 
}/* change this accordingly */
body{background:url('../../img/body_bg.png') no-repeat;}/* change this accordingly */

  .col-lg-1,
  .col-lg-2,
  .col-lg-3,
  .col-lg-4,
  .col-lg-5,
  .col-lg-6,
  .col-lg-7,
  .col-lg-8,
  .col-lg-9,
  .col-lg-10,
  .col-lg-11,
  .col-lg-12 {
    float: left;
  }
  .col-lg-1 {
    width: 8.333333333333332%;
  }
  .col-lg-2 {
    width: 16.666666666666664%;
  }
  .col-lg-3 {
    width: 25%;
  }
  .col-lg-4 {
    width: 33.33333333333333%;
  }
  .col-lg-5 {
    width: 41.66666666666667%;
  }
  .col-lg-6 {
    width: 50%;
  }
  .col-lg-7 {
    width: 58.333333333333336%;
  }
  .col-lg-8 {
    width: 66.66666666666666%;
  }
  .col-lg-9 {
    width: 75%;
  }
  .col-lg-10 {
    width: 83.33333333333334%;
  }
  .col-lg-11 {
    width: 91.66666666666666%;
  }
  .col-lg-12 {
    width: 100%;
  }
  .col-offset-1 {
    margin-left: 8.333333333333332%;
  }
  .col-offset-2 {
    margin-left: 16.666666666666664%;
  }
  .col-offset-3 {
    margin-left: 25%;
  }
  .col-offset-4 {
    margin-left: 33.33333333333333%;
  }
  .col-offset-5 {
    margin-left: 41.66666666666667%;
  }
  .col-offset-6 {
    margin-left: 50%;
  }
  .col-offset-7 {
    margin-left: 58.333333333333336%;
  }
  .col-offset-8 {
    margin-left: 66.66666666666666%;
  }
  .col-offset-9 {
    margin-left: 75%;
  }
  .col-offset-10 {
    margin-left: 83.33333333333334%;
  }
  .col-offset-11 {
    margin-left: 91.66666666666666%;
  }
}

@media (min-width: 768px) {

body{background:url('../../img/body_bg.png') no-repeat;}
  .row {
    margin-right: -15px;
    ;
  }
  
    p,h2,h1 {font-family: 'Just Another Hand', cursive;font-size:35px;letter-spacing:1px;}
   h3 {font-family: 'Just Another Hand', cursive;font-size:30px;letter-spacing:1px;}
  p.bd_fnt {font-family: 'Just Another Hand', cursive;font-size:30px;letter-spacing:1px;}
    p.bd_fnt2 {font-family: 'Just Another Hand', cursive;font-size:25px;letter-spacing:1px;}
}

 

@media screen and (max-width: 400px) {
  @-ms-viewport {
    width: 320px;
  }
body{background:url('../../img/body_bg.png') no-repeat;}


}
 

 

 

see u can add any css to bootstrap.. there is no rule mentioned that u can't add css according to ur needs bootstrap is just a framework that helps u to work faster but i would recommend u to learn some more about media queries before u start using bootstrap.. hope u get what i meant ;)

Edited by sash_oo7

  • Author

thanks for that, I have scrapped the boostrap idea for the time being just wanting to get this fixed image up for now, but will revert back to this later on. I am having a problem though with just the basic html and css, I end up with a really annoying problem, the image dimensions are 1366 x 768 yet when on the web page it seems to have a scroll bar down the side can anyone suggest why this is happening, please see the domain to view the problem.

 

www.kaynescooters.com

  • Author

Thank you so much sash_007,I think this shows I need to go and get back up to speed on the HTL & CSS front

 

KInd Regards

 

Tintin102

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.