html - 像 twitter bootstrap 一样的单杠图标

标签 html css internet-explorer-8 twitter-bootstrap

当屏幕缩小到@media(mobile~) 宽度时,我正在尝试创建选项图标,例如右上角的 twitter Bootstrap 图标。我做了一些逆向工程,能够在 Chrome 和 Safari 上重新创建图标。然而,它在 Firefox 中看起来有点不同,在 IE8 中则截然不同。

Image in Various browsers

寻求帮助来解决这个问题。

HTML:

<html>
<head>
  <link rel="stylesheet" type="text/css" href="optionspanel.css" />
</head>
<body>
  <ul id="nav">
    <li>
      <button type="button" class="fw-opt-panel">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a id="optionsicon" href="#" class="selected"></a>
        <ul>
            <li><a href="#">Item 01</a></li>
            <li><a href="#" class="selected">Item 02</a></li>
            <li><a href="#">Item 03</a></li>
        </ul>
        <div class="clear"></div>
    </li>
</ul>
<div class="clear"></div>

</body>
</html>

CSS:

.fw-opt-panel {
  background-color: rgb(14, 14, 14);
  background-image: -webkit-linear-gradient(top, rgb(21, 21, 21), rgb(4, 4, 4));
  border-bottom-color: rgba(0, 0, 0, 0.247059);
  border-radius: 4px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.0980392);
  border-width: 1px;
  border-top-width: 1px;
  box-shadow: rgba(255, 255, 255, 0.0980392) 0px 1px 0px 0px inset, rgba(255, 255, 255, 0.0745098) 0px 1px 0px 0px;
  cursor: pointer;
  float: right;
  padding: 7px;
}

.icon-bar {
  background-color: rgb(245, 245, 245);
  border-radius: 1px;
  cursor: pointer;
  display: block;
  height: 2px;
  margin-top: 3px;
  width: 18px;  
}

最佳答案

另一种方法是使用 triple bar Unicode 字符 - ☰ (U+2630)。它还提供许多不同的图标字体,这些字体修复了跨浏览器的差异,例如 Font Awesome 或 Entypo .

关于html - 像 twitter bootstrap 一样的单杠图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13689892/

相关文章:

javascript - 如何更改折叠元素的 CSS 填充类?

css - 在 IE8 中水平居中 div

javascript - 如何修复此代码以永远显示 10 秒并隐藏 10 秒?

html - div 粘在页面顶部的小问题

javascript - RSelenium 单选按钮不可点击

css - 为什么要使用 Transform-style : preserve-3d over z-index?

css - IE 无法处理带有 png 的可拖动 div?

javascript - IE8 : "The system cannot find the path specified" error when acessing window. 本地存储

html - 多个 Schema.org 产品项目及其在搜索引擎结果中的外观如何?

html - 如何用html格式化文本