angular - Cannot change the color of the cell of table when hover -


i using angular2-meteor ng2-bootstrap. try change color when hover on cell of table.

<table class="table table-hover table-bordered">     <thead>         <td>header1</td>         <td>header2</td>         <td>header3</td>     </thead>     <tbody>         <tr>             <td>lorem</td>             <td>aut</td>             <td>ieleniti</td>         </tr>         <tr>             <td>lorem</td>             <td>esse</td>             <td>ullam</td>         </tr>     </tbody> </table>    .table-hover > tbody > tr {   &:hover {     > td {       background-color: #ffffff;     }     > th {       background-color: #ffffff;     }   }   > td:hover {     background-color: #f5f5f5 !important;   } } 

the code runs in pure bootstrap, can see here.

but when use angular2 , meteor, css code won't work more.

i found problem, project angular2-meteor project. @ same time, using sass meteor.

when use styles: [...], sass meteor won't compile it.

there 2 solutions, both work:

  1. create file xxx.scss, , change use styleurls: ['xxx.scss']

  2. use css instead of scss codes in styles: [...].

p.s. these days met lot of weird style problems, because of problem.

for example, scss supports // comment, css not. when write codes in styles: [...], css codes before // work well, codes after // won't work. , didn't error in browser , compiler.

hope can people met similar style problems.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -