I’m developing a sub page for my website. I have a nav bar and footer. I just want to add a background image behind the nav bar just like this.
I tried ..
<div class="seo-content"></div>
.seo-content{
background: url("/images/ss.jpg");
background-size: cover;
}
But It’s not working as expected.
Now it showing like this way ..
If I add height property, it showing up. But I need to sketch actual image size to the screen. That’s why I used background-size: cover;
What’s wrong with my code?
3
Answers
Use to following code:
Is the div possibly a child of a floating div container?
If it’s the child of a floating div or enclosing element it would have zero height thus not showing the image.
Try inspect element to gain a bit more detail?
Try to set a fixed hight: