css物化中的可堆叠标签似乎不起作用

时间:2015-08-27 12:33:30

标签: materialize

materializecss中的Hoverable类似乎无法正常工作。如果我需要包含任何特殊文件或请发送正确的语法,请指导。我尝试过的是以下内容:

<table class="hoverable">
    <thead>
      <tr>
          <th data-field="id">Name</th>
          <th data-field="name">Item Name</th>
          <th data-field="price">Item Price</th>
      </tr>
    </thead>
</table>

1 个答案:

答案 0 :(得分:-1)

阅读评论@ manan-sheth,您必须在HTML中包含materializeCSS的文件,例如仅HEAD标记

<!DOCTYPE html>
 <html>
  <head>
   <meta charset="utf-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/css/materialize.min.css">
   <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/js/materialize.min.js"></script>
   <title>My hoverable table</title>
  </head>
  ...
 </html>

或者,如果您要下载MaterializeCSS并将这些文件保存在本地,则只需更改以下行:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/js/materialize.min.js"></script>

对于这一行,更改路径的路径

<link rel="stylesheet" href="myProject/css/materialice.min.css">
<script src="myProject/js/materialize.min.js"></script>

然后桌子就可以了。