My CSS markup:
.rowbgi {
background-image:url('img/gradient.png');
background-color:#cccccc;
}
My HTML markup:
<div class="span4 rowbgi">
<img class="img-circle" data-src="holder.js/140x140">
<h2>Heading</h2>
<p>Stack Overflow</p>
<p><a class="btn" href="#">View details </a></p>
</div><!-- /.span4 -->
I am not able to see the background image, but the color is seen in the background. The image is available in the path.
Can somebody tell me some silly mistake I am doing?
Nobody knows what you are doing, because you did not show it (eg. with jsfiddle ;P), but my first guess is that you have following file structure:
/index.html
,/css/style.css
,/img/gradient.png
.Now, mind that all the files linked from HTML/CSS have paths relative to them. So, if you keep CSS in /css
, then the path in CSS img/xxx
links to /css/img/xxx
. If I am guessing correctly and this is your case change the style to:
background-image:url(/img/gradient.png);
or
background-image:url(../img/gradient.png);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With