CSS目标可以包含许多类之一的元素

Dma*_*e05 4 html css css-selectors

我正在尝试定位一个可能有许多类之一的元素.是不是有更简单的方法来编写以下示例?我无法找到参考,但似乎应该有一个更有效的选择.

.myTable1 a, .myTable2 a, .myTable3 a, .myTable4 a
{
    text-decoration: underline;
}
Run Code Online (Sandbox Code Playgroud)

Zol*_*oth 5

试试 -

table[class^=myTable] a {
    text-decoration: underline;
}
Run Code Online (Sandbox Code Playgroud)