css 通配符选择器

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4 <meta charset="utf-8">
 5 <title>通配符</title>
 6 <script src="https://unpkg.com/vue/dist/vue.js"></script>
 7 <style type="text/css">
 8     /* 重点看这里,选择ID以“container_”开头的元素 */
 9     [id^='container_']{
10         background-color: darkseagreen;
11     }
12 </style>
13 </head>
14 <body>
15 <div id="app">
16   <div v-for="i in 10"><p v-bind:id="'container_'+i"> {{i}} </p></div>
17 </div>
18 
19 <script>
20 new Vue({
21   el: '#app',
22   data: {}
23 })
24 </script>
25 </body>
26 </html>

成功不是终点,失败也并非末日,重要的是前行的勇气!
原文地址:https://www.cnblogs.com/DSH-/p/10451588.html