How do I add a responsive background image in panel heading. Twiitter Bootstrap 3

Lbkv

Guys! I do really need to add some image as a bg to my panel heading. I also want h3 inside it. Here is my Code:

 <div class="row col-wrap">
            <div class="col-lg-4 col">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3>Simple</h3>
                    </div>
                    <div class="panel-body">
                        <ul class="list-group">
                            <li class="list-group-item alert alert-success">Smth
                            <span class="glyphicon glyphicon-ok pull-right"></span></li>
                            <li class="list-group-item alert alert-danger">smth1
                            <span class="glyphicon glyphicon-remove pull-right"></span></li>
                            <li class="list-group-item alert alert-danger">Smth2<span class="glyphicon glyphicon-remove pull-right"></span></li>
                            <li class="list-group-item alert alert-danger">Smth3<span class="glyphicon glyphicon-remove pull-right"></span></li>
                            <li class="list-group-item alert alert-danger">Smth4<span class="glyphicon glyphicon-remove pull-right"></span></li>
                        </ul>
                    </div>
                    <div class="panel-footer clearfix">
                        <h5 class="col-lg-6 col-xs-6">19 999р.</h5>
                        <button class="btn btn-success pull-right col-lg-6 col-xs-6" type="submit" data-toggle="modal" data-target="#standartCta">Choose</button>
                    </div>
                </div>
            </div>

Here is CSS:

.panel-heading{
background-image: url(../img/flowerbg.svg) no-repeat;
background-position: center;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;

}

Nothing happens. Bg is still filled with default bootstrap colour.

Joseph

Try Removing the no-repeat from background-image :)

The no-repeat belongs in its own property "background-repeat" unless you switch to the plain background statement then follow the other answer :)

For reference, you may want to peak at some documentation on short hand css declarations :) https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties

.panel-heading {
  background-image: url(https://c2.staticflickr.com/6/5551/15140731082_a2c3a4a2c4_n.jpg);
  background-position: center;
  background-size: cover;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row col-wrap">
  <div class="col-lg-4 col">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3>Simple</h3>
      </div>
      <div class="panel-body">
        <ul class="list-group">
          <li class="list-group-item alert alert-success">Smth
            <span class="glyphicon glyphicon-ok pull-right"></span>
          </li>
          <li class="list-group-item alert alert-danger">smth1
            <span class="glyphicon glyphicon-remove pull-right"></span>
          </li>
          <li class="list-group-item alert alert-danger">Smth2<span class="glyphicon glyphicon-remove pull-right"></span>
          </li>
          <li class="list-group-item alert alert-danger">Smth3<span class="glyphicon glyphicon-remove pull-right"></span>
          </li>
          <li class="list-group-item alert alert-danger">Smth4<span class="glyphicon glyphicon-remove pull-right"></span>
          </li>
        </ul>
      </div>
      <div class="panel-footer clearfix">
        <h5 class="col-lg-6 col-xs-6">19 999р.</h5>
        <button class="btn btn-success pull-right col-lg-6 col-xs-6" type="submit" data-toggle="modal" data-target="#standartCta">Choose</button>
      </div>
    </div>
  </div>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I make a background image responsive?

How do I add an image icon on top of a panel div using CSS and Bootstrap?

Bootstrap 3 / CSS: How to properly vertically align in panel heading

How do I keep a responsive background image from clipping?

How do I create a triangular responsive background image?

How do I make my website's background image responsive?

responsive background image bootstrap

How do I add a background image to a JPanel?

How do I add background image in webpage?

How do I add a background image in CSS?

How to add an image on ggplot background (not the panel)?

How to make panel-heading fixed with Bootstrap?

How do i create a background for a heading tag in html/css like this?

Bootstrap responsive jumbotron background image

Bootstrap Jumbotron Background Image Not Responsive

Responsive background image in bootstrap container

Vertical Bootstrap Panel Heading

How do I make this section background responsive?

How do I write on top of a background image with bootstrap 3.3?

How do I centre a heading (with text and image) to my div?

How do I create background image and add text over it

How do I add a background image to flutter app?

How do I add an Electron DMG background image?

How do I add a background image for a specific part of my page?

How do I add a top padding to a background image in css?

how do i add a "background color" behind my image

Using bootstrap grids, how can I add a responsive image and fit the grid

openpyxl: chart.title = "Chart Heading" not functional. How do I add the heading to a scatter chart?

How to display the background image behind heading text?