我有一个看起来像这样的 HTML 块:
<div id="header">
<h1>title</h1>
<h2>subtitle</h2>
</div>
我正在使用 CSS 技术来隐藏所有文本并将其替换为图像。但我想将整个区块链接到主页。我不能把它包装起来,<a>
因为那不符合标准。那么我该怎么做呢?
我的解决方案;灵感来自New in town
<div id="header">
<h1>title</h1>
<h2>subtitle</h2>
<a href="index.html">Home</a>
</div>
#header {
text-indent: -9999px;
width: 384px;
height: 76px;
background: transparent url(../images/header.png) no-repeat;
margin: 10px;
position: relative;
}
#header a {
display: block;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}