将汉堡图标添加到 bootstrap 侧边栏
Add burger Icon to bootstrap sidebar
我正在尝试将汉堡菜单添加到我的侧边栏。
我正在使用 bootstrap 侧边栏 - 版本 3.3.7,我的 bootstrap.min.css 被复制到我的文件夹:
<link rel="stylesheet" type="text/css" href="/bower_components/bootstrap/dist/css/bootstrap.min.css"/>
编码:
const contentHeader = (
<span>
<a href="#" onClick={this.menuButtonClick}>
<span class="glyphicon glyphicon-menu-hamburger">=</span>
</a>
<span> My Site - {this.state.selected}</span>
</span>);
当我在 运行 网站时看不到图标,我尝试调试网站
我缝这个元素是空的,当我编辑元素并添加 class="glyphicon glyphicon-menu-hamburger" 时,汉堡图标出现了。
image of the debug of the element
如何让图标一直出现?
我猜您正在使用该语法中的 JSX + React,在这种情况下,您需要在 html 属性中使用 className 而不是 class。
我建议使用 Atom 编辑器,它应该会为您突出显示该问题。
我正在尝试将汉堡菜单添加到我的侧边栏。
我正在使用 bootstrap 侧边栏 - 版本 3.3.7,我的 bootstrap.min.css 被复制到我的文件夹:
<link rel="stylesheet" type="text/css" href="/bower_components/bootstrap/dist/css/bootstrap.min.css"/>
编码:
const contentHeader = (
<span>
<a href="#" onClick={this.menuButtonClick}>
<span class="glyphicon glyphicon-menu-hamburger">=</span>
</a>
<span> My Site - {this.state.selected}</span>
</span>);
当我在 运行 网站时看不到图标,我尝试调试网站
我缝这个元素是空的,当我编辑元素并添加 class="glyphicon glyphicon-menu-hamburger" 时,汉堡图标出现了。
image of the debug of the element
如何让图标一直出现?
我猜您正在使用该语法中的 JSX + React,在这种情况下,您需要在 html 属性中使用 className 而不是 class。
我建议使用 Atom 编辑器,它应该会为您突出显示该问题。