Passion
Passion

Reputation: 81

CSS background:url Not working

The HTML code is

<style>
.banner_image{

    padding-top: 75px;
    padding-bottom: 50px;
    text-align: center;
    color: #f8f8f8;
    background: url(http://test.puurmondhygienist.nl/wp-content/uploads/2017/01/slide_bg_2400x1080.jpg) no-repeat center center;
    background-size: cover;
}
.banner_content{
    position: relative;
    padding-top: 6%;
    padding-bottom: 6%;
    margin-top: 12%;
    margin-bottom: 12%;
    background-color: rgba(0, 0, 0, 0.7);
    max-width: 660px;
}
</style>
             <div class="banner_image">
                    <div class="container">
                        <center>
                             <div class="banner_content">
                            
                                 <h1>We Sell Lifestyle</h1>
                                 <p>Flat 50% off on all brands</p>
                                 <a href="products.html"><input type="button" class="btn btn-danger btn-lg active" value="Shop Now"></a> 
                            </div>
                        </center>
                    </div>
                </div>
The image doesn't show up. Is there any issue with the CSS. I tried it many times, but that doesn't work. I even added the CSS file on the drive and tried it still it didnt worked, whats the issue? Please help.

Upvotes: 2

Views: 1036

Answers (1)

Ehsan feyzolahi
Ehsan feyzolahi

Reputation: 124

use:

background-image: url("http://test.puurmondhygienist.nl/wp-content/uploads/2017/01/slide_bg_2400x1080.jpg");

I think it would work with background-image property. not only background. and I put quotations for URL. then I removed no-repeat center center and the end of code

Upvotes: 1

Related Questions