【问题标题】:3D Transform Perspective not working until Dev Tools is open CSS在开发工具打开 CSS 之前,3D 变换透视图不起作用
【发布时间】:2019-11-12 01:48:46
【问题描述】:

该问题仅出现在 Firefox 中,样式在检查器打开之前将不起作用。我认为这与透视或变换风格有关,但我所做的似乎无济于事

CodePen

.id-card {
  height: 100%;
  min-height: 300px;
  position: relative;
  -moz-perspective: 1000px;
  -webkit-perspective: 1000px;
  perspective: 1000px;
}
.id-card-inner {
  border-radius: 10px;
  box-shadow: 0px 5px 10px 0px #bababa;
  text-align: left;
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  -moz-transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;

}
.id-card:hover .id-card-inner {
  transform: rotateY(180deg);
}
.id-card-front, .id-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -moz-backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  padding: 25px;
}
.id-card-front {
  z-index: 1;
}
.id-card-back {
  background-color: #fff;
  transform: rotateY(180deg);
  z-index: 1;
  overflow-y: auto;
}
.id-card img {
  max-width: 200px;
  float: right;
}

Video

感谢任何帮助,谢谢!

【问题讨论】:

    标签: html css


    【解决方案1】:

    height:300px 用于.id-card 它会起作用

    .id-card {
      /*height: 100%;*/
        height: 300px;
        min-height: 300px;
        position: relative;
        -moz-perspective: 1000px;
        -webkit-perspective: 1000px;
        perspective: 1000px;
        clear:both;
    }
    

    Check the updated codepen here

    【讨论】:

    • 谢谢!我现在可以看到为什么孩子们不“继承”高度,但是为什么这会影响从显示到检查器打开的样式?
    • 因为 min-height 在(mozilla)中不起作用,您的代码供您参考,请检查此答案why min-height is not working on mozilla
    猜你喜欢
    • 2022-06-30
    • 2019-01-24
    • 1970-01-01
    • 1970-01-01
    • 2011-12-11
    • 2015-03-29
    • 2013-10-05
    • 2012-10-28
    • 1970-01-01
    相关资源
    最近更新 更多