0

HTML

        <div class="bg">
      // some code and text nothing crazy 
        </div> 

css

  .bg {
    background-image: url("color.jpg");
    background-position: top;
    margin-top: -75px;
   }

I'm getting a white margin on both sides between my background image and the edge of the browser.Just trying to get my background image to stretch to the edge... at this point Ive tried a plethora of combos of ... background position, just reg position: relative/fixed etc. none seem to work. I also tried max-width and that didnt seem to help. Feel like I'm missing something obvious?

CodeRomeos
  • 2,428
  • 1
  • 10
  • 20
Ben Casalino
  • 2,262
  • 5
  • 20
  • 28

2 Answers2

0

Try to remove padding and margin to your body :

html, body {
    margin:0;
    padding:0;
}
lddz
  • 282
  • 1
  • 6
  • ahh that was a great idea i def didn't think of yet, but unfortunately it didn't work. Maybe because I'm using a div class it just cant be done and i need to call it via the body,html? – Ben Casalino Oct 06 '15 at 16:07
  • ahhhhh i had a container-fluid in my bootstrap navbar causing the issue, although I believe the 0 margin/padding would have fixed it. learn from my noob mistake everyone!! :) – Ben Casalino Oct 06 '15 at 16:16
0

ahhhhh i had a container-fluid in my bootstrap navbar causing the issue, although I believe the 0 margin/padding would have fixed it. learn from my noob mistake everyone!! :)

Ben Casalino
  • 2,262
  • 5
  • 20
  • 28