html - CSS 边框渲染优先级

标签 html css firefox

我有这个问题,无论我做什么,Firefox 和 IE 都拒绝在图像后面呈现边框,而 Chrome 和 Opera 可以。我已经将包含箭头的 div 移动到各处,甚至试图用 z-index 强制它,但它不会让步。有什么建议吗?

Chrome/Opera 和 IE/Firefox:

enter image description here

我在这里设置了一个 JSFiddle:http://jsfiddle.net/3Lqoxv2r/

CSS:

html {
  height: 100%;
  background: #eee;
}

body {
  background: url(../img/background.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  margin: 0px;
  height: 100%;
  overflow: hidden;
  background-position: center;
  font-family: Helvetica;
}

body.welcome {
  background: url(../img/welcome_background.jpg);
  background-size: cover;
  background-position: center;
}

p {
  margin: 0px;
}

::-webkit-scrollbar {
  width: 1px;
}

.wrapper {
  overflow-y: scroll;
  height: calc(100% - 90px);
}

header {
  position: static;
  top: 0;
  height: 60px;
}
header .logo {
  float: left;
  width: 256px;
}
header .logo .container {
  padding: 0 0 0 128px;
  height: 60px;
  background: white;
}
header .logo .container img {
  margin: 13px 0 0 0;
  width: 63px;
  height: 66px;
  filter: hue-rotate(0deg);
  -webkit-filter: hue-rotate(0deg);
  -moz-filter: hue-rotate(0deg);
  -o-filter: hue-rotate(0deg);
  -ms-filter: hue-rotate(0deg);
}
header .menu {
  float: left;
  background: white;
  width: calc(100% - 256px);
  height: 100%;
}
header .menu nav {
  float: left;
}
header .menu nav ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}
header .menu nav ul li {
  float: left;
  width: 128px;
  line-height: 57px;
  letter-spacing: -2px;
  text-align: center;
  font-size: 19px;
  text-transform: uppercase;
  color: #8a8a8a;
  border-top: 3px solid white;
}
header .menu nav ul li.active {
  color: #f05555;
  border-top: 3px solid #f05555;
}
header .menu .container {
  float: right;
  padding-right: 128px;
}

.before {
  content: "";
  position: absolute;
  top: 60px;
  left: 130px;
  border-top: 23px solid white;
  border-left: 28px solid transparent;
  border-right: 28px solid transparent;
}

div.content {
  width: 100%;
  height: calc(100% - 90px);
}
div.content .menu {
  height: 50px;
}
div.content .container {
  overflow-y: scroll;
  height: 100%;
  margin: 0 128px 0 128px;
  width: calc(100% - 256px);
  background: white;
}

footer {
  position: static;
  bottom: 0;
  height: 30px;
  background: white;
  padding: 0 0 0 128px;
  line-height: 30px;
  font-size: 10px;
  color: #8a8a8a;
}

最佳答案

您已将 position: static 用于 header 标记。使用 position: relative 代替,它将在 ff 和 IE11 中工作。

关于html - CSS 边框渲染优先级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26055687/

相关文章:

html - 在 DIV 中垂直居中多行文本

javascript - 如何在没有 Html-Imports 的情况下打包或导入 Html-Templates

javascript - 如果包含多个特定子项,如何更改元素文本

html - 如何在具有不同大小的子 div 的父 div 中居中文本(flexbox)

firefox - 在 Firefox 的 HTML Canvas 中绘制调整大小的 SVG 图像

css - 使div溢出:hidden effective without positioning it

jquery - Accordion 旁边的边框没有更新

html - Bootstrap 中的侧栏位置

css - Firefox 多重渐变背景错误

javascript - 使用 `nsIWebBrowserPersist saveURI` 或 Firefox 扩展中的其他内容重新启动下载?