如何制作整个红色区域' clickable'?如果我能提供帮助,我宁愿不使用Javascript。
https://jsfiddle.net/8m6z0h22/
.block {
width: 200px;
height: 272px;
background:red;
border: 0;
}

<div class="block">
<h3>Book a season ticket with Manchester United</h3>
<ul>
<li><a href="#" title="Read more about Manchester United">Read more about Manchester United <span class="bold">></span></a></li>
</ul>
</div>
&#13;
答案 0 :(得分:8)
将所有代码包含在<a>
代码中,而不是<div>
。
.block {
text-decoration: none;
width: 200px;
height: 272px;
background:red;
border: 0;
display: block;
}
.block h3 {
color: black;
}
.block ul li {
text-decoration: underline;
}
&#13;
<a href="#" title="Read more about Manchester United" class="block">
<h3>Book a season ticket with Manchester United</h3>
<ul>
<li>Read more about Manchester United <span class="bold">></span></li>
</ul>
</a>
&#13;
答案 1 :(得分:2)
请在提问前先搜索。
这些链接可能对您有所帮助
How to make an entire div clickable with CSS
How to make a whole 'div' clickable in html and css without javascript?
答案 2 :(得分:0)
您可以在a
.block {
width: 200px;
height: 272px;
background:red;
border: 0;
}
a{
text-decoration:none;
}
&#13;
<a href="#" title="Read more about Manchester United"><div class="block">
<h3>Book a season ticket with Manchester United</h3>
<ul>
<li>Read more about Manchester United <span class="bold"></span></li>
</ul>
</div>
</a>
&#13;
答案 3 :(得分:0)
只需将div放在锚标记内:
extends Activity