Sash
Sash

Reputation: 23

Whole section is ending up clickable

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

Answers (1)

Mark Simpson
Mark Simpson

Reputation: 2384

Somewhere else in your code, you probably have :

a {
    display: block;
}

Add this:

#slider a {display:inline-block}

Upvotes: 1

Related Questions