我有一個表,該表應該具有“table-class”類,但是該類甚至無法識別/讀取,並且屬性也不會顯示在表中。我正在使用 azure appServiceEditor,當我運行程式碼時,輸出只是一個預設樣式表,因此不會讀取 class="table-class" 的屬性。但是,當我插入任何其他類別而不是“表類”時,會顯示屬性。我不明白問題出在哪裡。
.table-class { position: absolute; display: block; font-family: arial, sans-serif; border-collapse: collapse; z-index: 10000000; background-color: rgba(0, 0, 0, 0.5); border-radius: 5%; color: white; } .table-class td, th { border: 1px solid #dddddd; text-align: left; padding: 8px; } .table-class tr:nth-child(even) { background-color: rgba(0, 0, 0, 0.6); }
<table class="table-class"> <tr> <th>Company</th> <th>Contact</th> <th>Country</th> </tr> <tr> <td>Alfreds Futterkiste</td> <td>Maria Anders</td> <td>Germany</td> </tr> <tr> <td>Centro comercial Moctezuma</td> <td>Francisco Chang</td> <td>Mexico</td> </tr> <tr> <td>Ernst Handel</td> <td>Roland Mendel</td> <td>Austria</td> </tr> <tr> <td>Island Trading</td> <td>Helen Bennett</td> <td>UK</td> </tr> <tr> <td>Laughing Bacchus Winecellars</td> <td>Yoshi Tannamuri</td> <td>Canada</td> </tr> <tr> <td>Magazzini Alimentari Riuniti</td> <td>Giovanni Rovelli</td> <td>Italy</td> </tr> </table>
使用此程式碼而不是表類別