带图标的 Material Design Lite 选项卡

Material Design Lite tabs with icons

我正在使用 Material Design Lite 选项卡(与 https://getmdl.io/templates/text-only/index.html). I would like the links to have an icon as with the Github and download link on the MDL site itself: https://getmdl.io

中显示的模板一样

但是,在 MDL 站点上,他们实际上使用的是导航栏,因此我目前无法通过选项卡重复这种外观。

答案其实很简单,虽然图标和后面的文字对齐有点不对(图标有点太高了)。您只需添加一个具有正确 类:

的跨度
<a href="#download" class="mdl-layout__tab">
    <span class="icon material-icons">get_app</span>
    <span>Download</span>
</a>