是否有有效的方法来更改超链接中的文本样式?
我试图按如下方式验证我的代码:
<ul class="work">
<li>
<a href="work1.html"> <img src="images/work_1.png" alt="Work 1 Logo" /> <h4>Lorem ipsum doler sit amet consectetur adipiscing elit.</h4> Work 1 </a>
</li>
<li>
<a href="work2.html"> <img src="images/work_2.png" alt="Work 2 Logo" /> <h4>Lorem ipsum doler sit amet consectetur adipiscing elit.</h4> Work 2 </a>
</li>
<li>
<a href="work3.html"> <img src="images/work_3.png" alt="Work 3 Logo" /> <h4>Lorem ipsum doler sit amet consectetur adipiscing elit.</h4> Work 3 </a>
</li>
</ul>
当然,我面临的问题是块级元素(h4)不应该位于内联元素(a)内。是否有任何 XHTML 1.0 严格有效的方法可以让我看到与现在使用此代码看到的相同效果? 通过在 (a) 中包含 (h4),我获得的独特的美学优势是,有两种不同的文本样式都受到同一锚点的影响。它实际上在我的页面上看起来相当不错!
I am trying to validate my code as follows:
<ul class="work">
<li>
<a href="work1.html"> <img src="images/work_1.png" alt="Work 1 Logo" /> <h4>Lorem ipsum doler sit amet consectetur adipiscing elit.</h4> Work 1 </a>
</li>
<li>
<a href="work2.html"> <img src="images/work_2.png" alt="Work 2 Logo" /> <h4>Lorem ipsum doler sit amet consectetur adipiscing elit.</h4> Work 2 </a>
</li>
<li>
<a href="work3.html"> <img src="images/work_3.png" alt="Work 3 Logo" /> <h4>Lorem ipsum doler sit amet consectetur adipiscing elit.</h4> Work 3 </a>
</li>
</ul>
The problem I am facing, of course, is that block-level elements (h4) should not be inside inline elements (a). Is there any XHTML 1.0 Strict valid way which will allow me to see the same effect that I see right now with this code?
The unique aesthetic benefit I get by having the (h4) within the (a) is the fact that there are two different text styles both being affected by the same anchor. It actually looks quite good on my page!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
h4
更改为span
并赋予它们相同的样式。Change your
h4
tospan
and give them the same styles.