Reputation: 23
I am having a strange problem but cannot see why. I have a banner in a section of the site but turns out the entire div has become clickable! Can you spot why?
<div id="slider" style="height:20%;">
<h2 style="background:#66c17d">
<span class="color1">sample text</span>
</h2>
<a href="http://www.domain.com/store">
<img class="sample" src="images/slide_sample2.png"/>
</a>
</div>
and the CSS
#slider {
height:40px;
background-image:url('images/bg.jpg');
text-align:center;
}
Please correct me!
Upvotes: 0
Views: 55
Reputation: 2384
Somewhere else in your code, you probably have :
a {
display: block;
}
Add this:
#slider a {display:inline-block}
Upvotes: 1