Reputation: 9173
It only redirects to the url when I click on either the image or the text. But not the whole <div>
. Any idea? Here's my code:
<a href="someurl">
<div class="story">
<img src="photo.jpg">
<div class="storyText">
<h1>title</h1>
<ul>
<li>list</li>
<li>list</li>
<li>list</li>
</ul>
</div>
</div>
</a>
Upvotes: 1
Views: 197
Reputation: 60573
you need to make the a
block level element, you can do that by setting display:block
in a
a {
border: solid red; /* demo */
display: block
}
a:hover {
background: rgba(0,0,0,.5) /* demo */
}
<a href="someurl">
<div class="story">
<img src="//placehold.it/100">
<div class="storyText">
<h1>title</h1>
<ul>
<li>list</li>
<li>list</li>
<li>list</li>
</ul>
</div>
</div>
</a>
Upvotes: 4