我有以下html结构(在wiki-content div中),我不知道如何到达它。
这似乎不起作用,你知道为什么吗?
.wiki-content .table-wrap relative-table.wrapped.confluenceTable
{
width: 100%;
}
谢谢
它不起作用,因为你有一个宽度设置为99.9315%的内联CSS值。内联样式在css之后得到处理,因此这将覆盖css文件中任何其他宽度设置。
尝试删除内联宽度设置。
你尝试过使用!important
吗?
.wiki-content .table-wrap relative-table.wrapped.confluenceTable
{
width: 100% !important;
}
您可以尝试这样做,并尝试将!important
覆盖现有宽度。
.table-wrap .relative-table.wrapped.confluenceTable
{
width: 100%!important;
}
如果内联样式宽度是由某个javascript生成的,则需要使用javascript重新初始化它。因为你不能使用css覆盖内联样式,因为它具有最大的特异性值。请阅读此链接关于https://css-tricks.com/specifics-on-css-specificity/
请参阅下面的javascript代码重新初始化宽度。
document.getElementsByClassName("relative-table").style.width = "100%";