表格行作为锚点 [英] table row as anchor
问题描述
我正在尝试将整个表格行设置为锚点.我在这里已经读到,将所有表行内容放在锚标记中不是一个好习惯,因为html标准不允许这样做.
I'm trying to set my entirely table row as an anchor. I've read here that It's not a good practice to put all table row content inside a anchor tag because the html standard doesn't permit this.
实现此目标的最佳策略是什么?
What's the best strategy to accomplish this?
我正在分析在每个表单元格中放置锚标记的可能性,就像我在此示例中在.day div上所做的那样: http://jsfiddle.net/XdfCp/4/这是一个好的解决方案吗?
I'm analysing the possibility to put an anchor tag inside each table cell, as I've done on .day div on this example: http://jsfiddle.net/XdfCp/4/ Is this a good solution?
此解决方案的问题是锚点没有覆盖所有表单元格空间.我已经以这种方式配置了锚点,但是并没有占用所有的单元空间:
The problem with this solution is that the anchor is not covering all table cell space. I've configured the anchor at this way, but It didn't take all cell space:
#ListaEventosPorMes a{
display: block;
width: 100%;
height: 100%;
color: White;
}
我需要的另一行为是在所有行中而不是在特定的表格单元锚上获得悬停效果.你有解决这个问题的想法吗?
The other behavior I need is to get the hover effect in all row and not on specific table cell anchor. Do you have any idea to resolve this?
推荐答案
自IE7以来,所有主流浏览器在所有元素(包括 tr
)上均支持:hover
CSS伪类,因此您不需要使用锚来设置悬停状态的样式.
All major browsers since IE7 support the :hover
CSS pseudoclass on all elements, including tr
, so you don't need to use an anchor to style the hover state.
As for your other question, take a look at this answer: Make link in table cell fill the entire row height
这篇关于表格行作为锚点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!