我希望选择所有以“my-element”开头的html元素。
例如:
会是这样的东西:
我该如何做到这一点?
例如:
my-element-1 {
background-color: red;
...
}
my-element-2 {
background-color: red;
...
}
my-element-3 {
background-color: red;
...
}
会是这样的东西:
[tag*="my-element"] {
background-color: red;
...
}
当选择类似这样的类时,该语法有效:
div[class^='myclass'], div[class*=' myclass']{
color: #F00;
}
我该如何做到这一点?