如何单击表中的单元格,而不会使其颜色蓝色(以HTML/CSS为单位)



屏幕截图:看起来很丑

有什么办法做到这一点吗?我实现了整个Bootstrap.css,除此之外,我没有其他CSS样式:(我还在标签中添加样式="背景:Antiquewhite")

table {
        border-collapse: collapse;
        border-spacing: 0;
        table-layout: fixed;
        margin: 3px 0; 
        text-align:center;
        cursor: default; 
    }

表的源代码很简单:

<table width="100%" id="a">
    <tr>
        <td><h2>a</h2></td>
    </tr>
</table>

此外,我在网站中使用popover,

<td data-container="body" data-toggle="popover" data-placement="bottom" data-html="true" data-content="<table width='100px'>
<tr>
<td><a href='http://www.google.com' target='_blank'>google</a></td>
</tr>
<tr>
<td><a href='http://www.google.com' target='_blank'>google</a></td>
</tr>
</table>
"><h4>something</h4></td>

我不知道如果不制作单元蓝色

,这是否仍然有效

显然是CSS规则集。

类似tr:active,但请提供CSS

尝试使用它,用普通表颜色的十六进制替换黄色:

td:active,
tr td:active,
td:hover,
tr td:hover {
    background-color: antiquewhite!important;
}

:active是元素单击后的状态(active), !important告诉CSS没有!important

您应该在浏览器中打开开发人员工具,然后选择有问题的单元格。它将向您显示与选择相关的所有CSS,并告诉您它来自哪个CSS文件。

相关内容

最新更新