다음과 같은 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;
}
나는 그 아이디어가 훌륭하다고 생각하지만, 당신의 의미가 잘못되었다고 생각합니다. '' 태그 안에 텍스트가 있어야하며, 헤더에 ''을 던지면 더 쉽게 작업 할 수 있습니다. – mpen