Skip to content Skip to sidebar Skip to footer

Twitter Bootstrap Modal Inserting A Background Image

I have a modal and I want to add a background image. I can change the background color of the entire modal and the background color inside the modal but I can't find a way to make

Solution 1:

Yeah it would be helpful to see the html of your modal and or find out which version of bootstrap you are using.

Here is an example of setting the background of an modal in Bootstrap 3. In this example the background encompasses the whole modal. But you could also adjust it to only the background of the body etc..

.modal-content{
    background-image: url('pathToImage');
}

Example

http://www.bootply.com/94443

Solution 2:

You can use an image in your modal content div, just before contents.

  <img id="print-background" src="~/logo.png"/>  

Then use @media print in your css:

@media print {
img {
        opacity: 0.3;
        position: absolute;
        left: 2%;
        top: 100px;
    }
}

Post a Comment for "Twitter Bootstrap Modal Inserting A Background Image"