小编Guy*_*Guy的帖子

css z-index 嵌套元素的问题

我想在 z 平面上订购 3 个 HTML 元素:

.bank {
  width: 200px;
  height: 200px;
  background-color: grey;
  position: absolute;
  
  z-index: 100;
  
  transform: translateY(10%);
}

.card {
  width: 100px;
  height: 100px;
  background-color: red;
  
  position: absolute;
  left: 50px;
  top: 50px;
  
  z-index: 300;
}

.button {
  width: 50px;
  height: 50px;
  background-color: green;
  
  position: absolute;
  left: 30px;
  top: 50px;
  
  z-index: 200;
}
Run Code Online (Sandbox Code Playgroud)
<div class="bank">
       bank
       <div class="card">card</div>
    </div>
    
    <div class="button">button</div>
Run Code Online (Sandbox Code Playgroud)

我希望按钮位于银行顶部但后面。但无论我如何尝试,按钮始终位于银行卡的顶部。

编辑:我注意到从“.bank”中删除 z-index 和转换可以解决这个问题,但我需要转换属性。我能做些什么?

什么可能导致它无法工作?谢谢

css z-index

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

Colab上的Tensorflow Eager执行

我试图在Colab笔记本上使用Tensorflow进行急切执行,但是我收到一条错误消息:

import tensorflow as tf
import tensorflow.contrib.eager as tfe

tf.enable_eager_execution()
Run Code Online (Sandbox Code Playgroud)

ValueError:必须在程序启动时调用tf.enable_eager_execution

我尝试单击"重置运行时"以便在启动时运行tf.enable_eager_execution但错误再次上升.

打开一个不同的笔记本没有帮助.

我可以在Colab中做什么,以便在此错误发生后允许急切执行?

谢谢.

python eager tensorflow google-colaboratory

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

标签 统计

css ×1

eager ×1

google-colaboratory ×1

python ×1

tensorflow ×1

z-index ×1