小编ran*_*min的帖子

两个固定元素的z-index不起作用

我有两个固定的容器,#meta并且#meta-container,其中#meta应始终在前台,因为它是一个全球性的控制元件.

我的代码看起来像这样

#meta-container {
  position: fixed;
  z-index: 1;
  left: 0; right:0;
  bottom:0; top: 0;
  background-color: red;
  color: rgba(0, 0, 0, 0.87);
}

#meta {
  position: fixed;
  z-index: 2;
  top: 40%;
  width: 60px;
  height: 25px;
  display: flex;
  background-color: black;
}
Run Code Online (Sandbox Code Playgroud)
<div>
  <span id="meta">
      <span class="bar"></span>
  <span class="bar"></span>
  <span class="bar"></span>
  <span class="bar"></span>
  <span class="bar"></span>
  </span>
  #meta
</div>
<div id="meta-container" class="slidein">
  #meta-container
</div>
Run Code Online (Sandbox Code Playgroud)

但是span#meta没有显示在上面div#meta-container.我没有在z-index某处重新分配.我也改变了z-index测试的价值,但没有帮助.我究竟做错了什么?

这么久 - 编码很开心.

(1)编辑:更正了代码段中的拼写.Snippet现在正在工作(遗憾的是不是我的代码).

html css html5 css-position css3

5
推荐指数
1
解决办法
1823
查看次数

display:flex - 在firefox 21中不起作用

根据这篇文章,该display:flex属性应该在firefox 21中没有任何前缀.但是,即使我-moz-在值之前使用它,它也不会被HTML解析器识别.

我尝试卸载firefox 20并重新安装firefox 21,最近希望它可以正常工作,但事实并非如此.

使用Web开发人员工具时,我可以看到以下警告和错误:

[10:23:04.673] The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. @ `http://localhost/index.php`
[10:23:04.712] Error in parsing value for 'display'.  Declaration dropped. @ `http://localhost/index.css:6`

[10:23:04.712] Error in parsing value for …
Run Code Online (Sandbox Code Playgroud)

html css html5 css3 flexbox

1
推荐指数
1
解决办法
2913
查看次数

标签 统计

css ×2

css3 ×2

html ×2

html5 ×2

css-position ×1

flexbox ×1