除了Google自定义搜索外,我如何使用所有表的CSS属性?

时间:2018-08-17 22:00:20

标签: css wordpress google-custom-search

我正在创建一个网站,并且使用了Google自定义搜索。当我尝试为th添加边框时,他们也申请了我的GCSE。它在那里出现时看起来很丑。我试图弄清楚如何使用除google自定义搜索之外的所有CSS代码表。这是我的网站,https://vendabariulo.gov.bd/citizen-charter/

这是我的代码,

th, td {
text-align: left;
padding: 8px;
border: 1px solid #ddd;
}

这是我的搜索按钮屏幕截图,周围显示边框。如果我从th删除边框,则它看起来很漂亮。

enter image description here

3 个答案:

答案 0 :(得分:1)

您可以尝试设置Google自定义搜索的样式。

此规则可能会对您有所帮助

gsc-search-box th, gsc-search-box td {
    /* apply your rules here as you like.
    For example, border:none; */
}

答案 1 :(得分:1)

谢谢。经过半个小时的思考和尝试,我发现了一些问题。对我来说有用。我认为这是有效的CSS规则。

我将div类添加到 google自定义搜索代码中,然后添加此简单代码,

.gcse td, th, tr {
border: none;
}

答案 2 :(得分:0)

developer.mozilla.org中将:not() CSS伪类用作准则

    table:not(table.gsc-search-box){ 

    /* your style definition */

        text-align: left;
        padding: 8px;
        border: 1px solid #ddd;

     }

希望有帮助。

相关问题