[英]How do I make these <a>'s work for Firefox instead of just Internet Explorer 6
This code only works for Internet Explorer 6, I don't know how to make it work for Firefox. 该代码仅适用于Internet Explorer 6,但我不知道如何使其适用于Firefox。 I'm using hyperlinks that contain table rows to change the content on the page. 我正在使用包含表行的超链接来更改页面上的内容。 However, on firefox the links become unclickable... 但是,在Firefox上,链接变得不可点击...
Here is the CSS: 这是CSS:
#sidebar {display:block; top:116px; left:11px; width:150px; position:fixed;}
.sidebarLink a:hover td { cursor:pointer; background-color:#f60;
color:#fff; border: 1px solid #f60;;}
.sidebarLink td{background-color:#fff; color:#f60; border: 1px solid #ccc;;}
.sidebarLink {font-family: sans-serif; font-weight: bold; font-size: small;}
And the HTML: 和HTML:
<div id="sidebar">
<table style="table-layout: fixed; word-wrap: break-word border-collapse: collapse;" class="sidebarLink" cellpadding="5" cellspacing="4" width="150">
<a href="index.php?test=table1">
<tr align="middle">
<td>Link 1</td>
</tr>
</a>
<a href="index.php?test=table2">
<tr width="90" align="middle">
<td>Link 2</td>
</tr>
</a>
</table>
</div>
I could turn this into a form with buttons and style the buttons to look like I have the table right now. 我可以将其转换为带有按钮的表单,并对按钮进行样式设置,使其看起来像现在的桌子一样。 The problem is that causes a performance issue with the table itself and the onHover feature so it would be great if someone knows a way to make this function in firefox. 问题是导致表本身和onHover功能导致性能问题,因此如果有人知道在Firefox中实现此功能的方法,那就太好了。
That's completely bogus HTML and I'm amazed it even works in IE6. 这完全是伪造的HTML,我很惊讶它甚至可以在IE6中使用。 You can't just put arbitrary elements between a table and its cells. 您不能只在表及其单元格之间放置任意元素。
It doesn't look like you should need a table for this at all? 看起来您根本不需要一张桌子吗? Just have the two links (maybe in a list) and give them display: inline-block;
只需要两个链接(也许在列表中)并display: inline-block;
它们即可display: inline-block;
and width: 75px
;. 和width: 75px
Incidentally, there are more browsers than Firefox and IE6 nowadays, and IE6 has got to be wayyy at the bottom of the popularity ladder by now. 顺便说一句,如今的浏览器比Firefox和IE6还要多,而IE6如今在流行阶梯的底部已经变得风风火火了。 Even Google largely gave up on it years ago. 甚至谷歌几年前也基本上放弃了。
Why not do: 为什么不这样做:
<div id="sidebar">
<table style="table-layout: fixed; word-wrap: break-word border-collapse: collapse;" class="sidebarLink" cellpadding="5" cellspacing="4" width="150">
<tr align="middle">
<td><a href="index.php?test=table1"> Link 1</a></td>
</tr>
<tr width="90" align="middle">
<td><a href="index.php?test=table2">Link 2</a></td>
</tr>
</table>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.