有效的HTML标题

dou*_*oug 2 html validation header

有没有办法写一个有效的标题/链接/图像?就像是

<a href="index.html"><h1 id="logo">Company name</h1></a> 
Run Code Online (Sandbox Code Playgroud)

(图像设置为背景,文本向左移动,因此通过css不可见)

ror*_*ryf 7

就像是:

<h1 id="logo"><a href="index.html">Company Name</a></h1>

#logo a {
    display: block;
    width: 200px; /* width and height equal to image size */
    height: 100px;
    background: transparent url(images/logo.png) no-repeat;
    text-indent:-9999px;
}
Run Code Online (Sandbox Code Playgroud)

原始标记的问题是它<a>是内联元素并且<h1>是块元素.内联元素不能包含块元素.