使整个 div 成为超链接
Make entire div a hyperlink
如何将我的整个 pad
div 区域设为超链接?
这是我的 HTML:
<div class="pad">
<div href="http://www.google.com" style="height:286px;width:286px;background:url('http://placehold.it/1x1') top center no-repeat;background-size:cover">
<div>
<span>View all</span>
</div>
</div>
</div>
<a href='http://www.google.com'>
<div class="pad">
<div style="height:286px;width:286px;background:url('http://placehold.it/1x1') top center no-repeat;background-size:cover">
<div>
<span>View all</span>
</div>
</div>
</div>
</a>
给整个东西加上一个标签!
使用 "onclick=" 事件代替 href
<div onclick="document.location='http://www.google.com'> ...
如何将我的整个 pad
div 区域设为超链接?
这是我的 HTML:
<div class="pad">
<div href="http://www.google.com" style="height:286px;width:286px;background:url('http://placehold.it/1x1') top center no-repeat;background-size:cover">
<div>
<span>View all</span>
</div>
</div>
</div>
<a href='http://www.google.com'>
<div class="pad">
<div style="height:286px;width:286px;background:url('http://placehold.it/1x1') top center no-repeat;background-size:cover">
<div>
<span>View all</span>
</div>
</div>
</div>
</a>
给整个东西加上一个标签!
使用 "onclick=" 事件代替 href
<div onclick="document.location='http://www.google.com'> ...