html - CSS 中的转换属性问题

标签 html css

我正在尝试旋转位于另一个 div 内的 div。我的代码有什么问题。我遇到了另一种方法(:在 child 之前)但是这个方法有什么问题?谢谢

body {
  background: #ccc
}
.box {
  width: 70%;
  height: 200px;
  background: #FFF;
  margin: 40px auto;
}
.effect2 {
  position: relative;
}
.box1 {
  transform: rotate3d;
  position: absolute;
  width: 20%;
  height: 20px;
  background-color: aqua;
}
<div class="box effect2">
  <div class="box1"></div>
</div>

最佳答案

body {
  background: #ccc
}
.box {
  width: 70%;
  height: 200px;
  background: #FFF;
  margin: 40px auto;
}
.effect2 {
  position: relative;
}
.box1{
    transition: 1.5s;
    position: absolute;
    width: 20%;
    height: 20px;
    background-color: aqua;
}
.box1:hover{
          transform: rotate3d(1,-1, 1,60deg);
       }
<div class="box effect2">
  <div class="box1"></div>
</div>

关于html - CSS 中的转换属性问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27566689/

相关文章:

javascript - ios 的硬件加速 css3 转换

当里面有文本时,HTML 列表项会错位

php - Bootstrap Affix-bottom 不向上滚动

html - 视频背景仅播放1个视频

javascript - div 标签的独立动画事件

python - jinja2 模板中的 url 函数在 Django 中抛出 AttributeError

css - 无法在 React 应用程序中导入 css 样式

html - 使我的图像在某些部分变得模糊

html - 显示 CSS 文件中的图像

css - DIV Horizo​​ntal Scroll Bar 为主水平滚动条