I have been trying to add background image to a div class using CSS, but I didn't have any success.
HTML code:
<header id="masthead" class="site-header" role="banner">
<div class="header-shadow"></div>
<hgroup></hgroup>
<nav role="navigation" class="site-navigation main-navigation">
</nav><!-- .site-navigation .main-navigation -->
</header><!-- #masthead .site-header -->
CSS:
.header-shadow{
background-image: url('../images/header-shade.jpg');
}
Additional information:
This is an image with a shadow and I am using it at the top of the website, so it mustn't have a particular width.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…