Skip to main content
Known Participant
September 15, 2015
Question

can jumbotron background image be width="100%"?

  • September 15, 2015
  • 1 reply
  • 657 views

Hi you helpful people you

I am trying to create a responsive image with text over it, where the text shows separately as the size gets smaller.

I am using a Jumbotron because I can't think of any other way to do it, but my problem is that the picture won't fill the screen like it does if I just had the picture alone with width set at 100%:

Is there any way besides the jumbotron to achieve this?

My code on the jumbotron is:

  <div class="jumbotron">

    <p><br /><br /><br /><br /></p>

     

    <h1>Kairos Prison Ministry</h1>

    <p><br /><br /><br /><br /><br /><br />The mission of Kairos Prison Ministry is to share the transforming  love and forgiveness of Jesus Christ<br>

to impact the hearts and lives of  incarcerated men, women and youth, as well as their families, <br>

to become loving  and productive citizens of their communities.<br /><br />

    </p>

    <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a><br /><br /></p>

  </div>

and my CSS is:

.jumbotron {

  background-image: url(../images/hands_bars.jpg);

  background-repeat: no-repeat;

  display: block;

  background-size:cover;

  width: 100%;

  padding: 0px;

  margin-bottom: 0px;

  margin-top: 0px;

  background-color: #3458B8;

}

.jumbotron .container {

  width: 100%;

}

Thanks as always for your help!

    This topic has been closed for replies.

    1 reply

    kpmiAuthor
    Known Participant
    September 15, 2015

    I just figured it out!!! I added "width="100%" to the jumbotron tag, and that seems to do what the CSS didn't.

    But how do I get rid of the white space under the jumbotron? I have set all padding and margins to "0" but it's still there. (see CSS above)

    Thanks!