-2

I am creating a website and I used google custom search for it. When I trying to add a border for th, td they also applied for my GCSE. It looks ugly when it appears there. I am trying to figure out how can I use my CSS code all table except google custom search. Here is my website, https://vendabariulo.gov.bd/citizen-charter/

Here is my code,

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

Here is my search button screenshot, there shows a border around it. If I remove border from th, td it looks beautiful.

enter image description here

3 Answers3

1

You could try to style the Google Custom Search itself.

This rule might help you

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

Thanks all. After thinking and trying half an hour, I figure out something. It's work for me. I think it's a valid CSS rule.

I add a div class to my google custom search code and add this simple code,

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

Use :not() CSS pseudo-class as doctrine in developer.mozilla.org

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

    /* your style definition */

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

     }

Hope it helps.

Houy Narun
  • 1,557
  • 5
  • 37
  • 86