What exactly does this CSS selector with a comma match?

后端 未结 3 1226
名媛妹妹
名媛妹妹 2021-01-26 20:57

I have a question about CSS selectors.

In my CSS file I have the following code:

.table_legenda th, td {
    text-align: left;
    vertical-align: top;
          


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-26 21:43

    The , means selecting another attribute so what you should do is:

    .table_legenda th,.table_legenda td {
    text-align: left;
    vertical-align: top;
    font-weight: bold;
    color: #76818a;
    border-bottom: 1px solid #76818a;
    border-left: 1px solid #76818a;
    white-space: nowrap;
    overflow: hidden;
    }
    

提交回复
热议问题