开发者

CSS class question for multiple elements

开发者 https://www.devze.com 2023-03-25 07:47 出处:网络
table.rightlist td { text-align:right; } table.rightlist th { te开发者_运维问答xt-align:right; } The above code works, but when I tried making
table.rightlist td
{
    text-align:right;
}

table.rightlist th
{
    te开发者_运维问答xt-align:right;
}

The above code works, but when I tried making

table.rightlist td,th
{
    text-align:right;
}

the th,td isn't working, it only aligns for td, but not for th


You need to fully specify each selector when comma separating them,

table.rightlist td,
table.rightlist th
{
    text-align:right;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消