添加backface-visibility:hidden
您.front-of-book-front
,使后开和关闭操作透明。
另外,我建议你使用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-index的角色有些困惑。你说了太多的背面知名度和更多的Z-索引,你能否进一步解释为什么它太多而太少的原因,所以我完全理解。再次感谢 – alexis
通常情况下,您应该使用多少background-visibility限制:hidden?出于类似的性能原因? – alexis
谢谢,我已经更新了我的答案。显然,“背面可见性:隐藏”没有限制。另外我错了z索引。我的错。 –