Css 转换后的书不是';我不能在fire fox和micro edge中工作为什么以及如何修复它?
在firefox中,转换和转换似乎无法正常工作,我在所有内容中都添加了-moz-前缀,但它似乎对增强功能没有任何影响。我有一本书可以在鼠标悬停时打开,但在fire fox中,这本书不会一直打开,而是在鼠标离开它之前关闭。书中未使用的转换和变换似乎正在工作,书中的转换和变换似乎是问题所在。至于微软的边缘,它的工作,但背景图像,前abd后,pesudo元素和一个div,我有它,没有出现。这本书的封面在microsoft edge上是空白的。有经验的人理解这里的问题吗?它在chrome中运行良好,但在firefox中不起作用Css 转换后的书不是';我不能在fire fox和micro edge中工作为什么以及如何修复它?,css,css-transitions,css-transforms,Css,Css Transitions,Css Transforms,在firefox中,转换和转换似乎无法正常工作,我在所有内容中都添加了-moz-前缀,但它似乎对增强功能没有任何影响。我有一本书可以在鼠标悬停时打开,但在fire fox中,这本书不会一直打开,而是在鼠标离开它之前关闭。书中未使用的转换和变换似乎正在工作,书中的转换和变换似乎是问题所在。至于微软的边缘,它的工作,但背景图像,前abd后,pesudo元素和一个div,我有它,没有出现。这本书的封面在microsoft edge上是空白的。有经验的人理解这里的问题吗?它在chrome中运行良好,但在
将
背面可见性:隐藏添加到您的中。书籍正面的正面
使其在打开和关闭操作后透明
另外,我建议您使用3d变换进行硬件加速
更新的css:
.front-of-book-front,
.back-of-book-front,
.book-front,
.book-back,
.book{
width: 100px;
height: 160px;
position: relative;
perspective: 800px;
}
.book{
margin: 52px auto;
transition: transform 1s ease-in-out 0s;
}
.book-front{
position: relative;
transform-style: preserve-3d;
transform-origin: left;
transition: transform 1s ease-in-out 0s;
box-shadow: 0px 3px 5px 2px rgba(0,0,0,.5);
perspective: 400px;
perspective-origin: -200px;
}
.front-of-book-front{
background-image: url("images/mainCover.jpg");
background-repeat: no-repeat;
background-size: cover;
background-position: 47%;
}
.front-of-book-front:before{
content: "Seraph Chronicles: Evangelion";
text-shadow: 2px 2px 1px rgba(0,0,0,.5);
font-size: .5em;
line-height: 15px;
color: white;
width: 119px;
height: 15px;
background-color: rgba(255,165,0,.5);
position: absolute;
text-align: center;
transform: translate3d(8px,93px,0) rotateZ(90deg);
}
.front-of-book-front:after{
content: "";
width: 75px;
height: 12px;
background-color: rgba(255,165,0,.5);
position: absolute;
transform: translate3d(0px,19px,0);
}
.bar{
width: 80px;
height: 8px;
background-color: rgba(0,0,0,.8);
font-size: .3em;
color: white;
text-align: right;
transform: rotateZ(90deg) translate3d(36px,-45px,0);
}
.bar p{
padding: 2px 3px 0 0 ;
display: block;
}
.back-of-book-front{
backface-visibility: hidden;
background-color: rgb(240,234,214);
transform: rotateY(180deg);
position: absolute;
top: 0;
}
.book:hover .book-front {
transform: rotateY(-180deg);
}
.book:hover{
transform: rotateZ(10deg);
}
.book-back{
position: absolute;
top:0;
background-color: rgb(240,234,214);
z-index: -1;
box-shadow: 3px 3px 5px 0 rgba(0,0,0,.5);
text-align: justify;
}
.book-back p{
font-size: .3rem;
margin: 2.9em 1.9em;
}
@media screen and (min-wdith:400px){
.front-of-book-front,
.back-of-book-front,
.book-front,
.book-back,
.book{
width: 113px;
height: 180px;
}
.front-of-book-front:before{
width: 133px;
height: 17px;
transform: translate3d(8px,105px,0) rotateZ(90deg);
}
.front-of-book-front:after{
width: 83px;
height: 14px;
transform: translate3d(0,21px,0);
}
.bar{
width: 95px;
height: 10px;
background-color: rgba(0,0,0,.8);
font-size: .3em;
color: white;
text-align: right;
transform: rotateZ(90deg) translate3d(42px,-45px,0);
}
.book-back p{
font-size: .4rem;
margin: 2.9em 1.9em;
}
.book-side{
width: 176px;
height: 10px;
top:-3px;
}
}
@media screen and (min-width:860px){
.front-of-book-front,
.back-of-book-front,
.book-front,
.book-back,
.book{
width: 200px;
height: 320px;
}
.front-of-book-front{
perspective: 200px;
}
.front-of-book-front:before{
width: 234px;
height: 37px;
transform: translate3d(11px,185px,0) rotateZ(90deg);
font-size: 1em;
line-height: 37px;
}
.front-of-book-front:after{
width: 146px;
height: 26px;
transform: translate3d(0,32px,0);
}
.bar{
width: 172px;
height: 23px;
background-color: rgba(0,0,0,.8);
font-size: .3em;
color: white;
text-align: right;
transform: rotateZ(90deg) translate3d(74px,-82px,0);
font-size: .7em;
}
.bar p{
display: block;
padding: 12px 5px 0 0;
}
.book-side{
width: 312px;
height: 10px;
top:-1px;
left: -5px;
}
.book-back p{
font-size: .7em;
margin: 3.3em 2.3em;
}
}好的,非常感谢,你会得到最好的答案,我只是想确保我完全理解,这样我就不会再犯错了。这件事引起了轩然大波。我把悬停css放在封面的前面,当它在y轴上旋转时,它就不在光标下了,谢谢。但我对背面可见性和z索引所起的作用有点困惑。你说背面可见性太高,z指数太多,你能进一步解释一下为什么它们太多太少,所以我完全理解。再次感谢您通常使用背面可见性的数量有限制吗:隐藏?出于性能原因?谢谢,我更新了我的答案。显然,背面可见性没有限制:隐藏。而且,我对z索引的理解是错误的。我的错,刚刚给了你赏金对不起,我以为它会自动给你最好的答案
.front-of-book-front,
.back-of-book-front,
.book-front,
.book-back,
.book{
width: 100px;
height: 160px;
position: relative;
perspective: 800px;
}
.book{
margin: 52px auto;
transition: transform 1s ease-in-out 0s;
}
.book-front{
position: relative;
transform-style: preserve-3d;
transform-origin: left;
transition: transform 1s ease-in-out 0s;
box-shadow: 0px 3px 5px 2px rgba(0,0,0,.5);
perspective: 400px;
perspective-origin: -200px;
}
.front-of-book-front{
background-image: url("images/mainCover.jpg");
background-repeat: no-repeat;
background-size: cover;
background-position: 47%;
}
.front-of-book-front:before{
content: "Seraph Chronicles: Evangelion";
text-shadow: 2px 2px 1px rgba(0,0,0,.5);
font-size: .5em;
line-height: 15px;
color: white;
width: 119px;
height: 15px;
background-color: rgba(255,165,0,.5);
position: absolute;
text-align: center;
transform: translate3d(8px,93px,0) rotateZ(90deg);
}
.front-of-book-front:after{
content: "";
width: 75px;
height: 12px;
background-color: rgba(255,165,0,.5);
position: absolute;
transform: translate3d(0px,19px,0);
}
.bar{
width: 80px;
height: 8px;
background-color: rgba(0,0,0,.8);
font-size: .3em;
color: white;
text-align: right;
transform: rotateZ(90deg) translate3d(36px,-45px,0);
}
.bar p{
padding: 2px 3px 0 0 ;
display: block;
}
.back-of-book-front{
backface-visibility: hidden;
background-color: rgb(240,234,214);
transform: rotateY(180deg);
position: absolute;
top: 0;
}
.book:hover .book-front {
transform: rotateY(-180deg);
}
.book:hover{
transform: rotateZ(10deg);
}
.book-back{
position: absolute;
top:0;
background-color: rgb(240,234,214);
z-index: -1;
box-shadow: 3px 3px 5px 0 rgba(0,0,0,.5);
text-align: justify;
}
.book-back p{
font-size: .3rem;
margin: 2.9em 1.9em;
}
@media screen and (min-wdith:400px){
.front-of-book-front,
.back-of-book-front,
.book-front,
.book-back,
.book{
width: 113px;
height: 180px;
}
.front-of-book-front:before{
width: 133px;
height: 17px;
transform: translate3d(8px,105px,0) rotateZ(90deg);
}
.front-of-book-front:after{
width: 83px;
height: 14px;
transform: translate3d(0,21px,0);
}
.bar{
width: 95px;
height: 10px;
background-color: rgba(0,0,0,.8);
font-size: .3em;
color: white;
text-align: right;
transform: rotateZ(90deg) translate3d(42px,-45px,0);
}
.book-back p{
font-size: .4rem;
margin: 2.9em 1.9em;
}
.book-side{
width: 176px;
height: 10px;
top:-3px;
}
}
@media screen and (min-width:860px){
.front-of-book-front,
.back-of-book-front,
.book-front,
.book-back,
.book{
width: 200px;
height: 320px;
}
.front-of-book-front{
perspective: 200px;
}
.front-of-book-front:before{
width: 234px;
height: 37px;
transform: translate3d(11px,185px,0) rotateZ(90deg);
font-size: 1em;
line-height: 37px;
}
.front-of-book-front:after{
width: 146px;
height: 26px;
transform: translate3d(0,32px,0);
}
.bar{
width: 172px;
height: 23px;
background-color: rgba(0,0,0,.8);
font-size: .3em;
color: white;
text-align: right;
transform: rotateZ(90deg) translate3d(74px,-82px,0);
font-size: .7em;
}
.bar p{
display: block;
padding: 12px 5px 0 0;
}
.book-side{
width: 312px;
height: 10px;
top:-1px;
left: -5px;
}
.book-back p{
font-size: .7em;
margin: 3.3em 2.3em;
}