請教一下各位大神老師,照著寫的代碼,但是顯示的和視頻里面的不一樣啊
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>css3+js實現散列畫廊特效</title> <style type="text/css"> *{padding: 0;margin: 0;}? //所有標簽都會遵從這個樣式 body{ background-color: #fff; color:#555; font-family: 'Avenir Next','Lantinghei SC'; font-size: 14px; -webkit-font-smoothing: antialiased;?? //字體平滑 } .wrap{ width:100%; height :600px; position: absolute; top:50%; margin-top: -300px; background-color:#333 ; overflow: hidden; } //海報樣式 .photo{ width:260px; height: 320px; position:absolute; z-index: 1; box-shadow: 0 0 1px rgda(0,0,0,.01); } .photo.side{ width: 100%; height:100%; background-color: #eee; position:absolute; top:0; right:0; padding:20px; box-sizing: border-box; } .photo.side-front{} .photo.side-front.image{ width :100px; height: 250px; line-height: 250px; overflow:hidden; } .photo.side-front.image img{ width: 100%; } .photo.side-front.caption{ text-align: center; font-size: 16px; line-height: 50px; } .photo.side-back{} .photo.side-back.de1{ color: #666; font-size: 14px; line-height: 1.5em; } //當前選中的海報樣式 .photo-center{ left:50px; top:50px; margin-top: -160px 0 0 -130px; z-index: 999; } </style> </head> ? <body onselectstart="return false;">??????????? <div class="wrap"> <div class="photo"> <div class="side side-front">??? <p class="image"><img src="圖片/2.jpeg" ></p> <p class="caption">2</p>??? </div> <div class="side side-back"></div> ?? <p class="desc">描述的文字</p> </div> </div> </body></html>
2017-03-30
2017-03-28
這問題我也遇到了估計,和瀏覽器有關
2017-03-25
<!DOCTYPE html>
<html>
?<head>?
? <meta charset="UTF-8" />?
? <title>css3+js實現散列畫廊特效</title>?
? <style>
*{
padding: 0;
margin: 0;
}
body{
background-color: #fff;
color: #555;
font-family: "Avenir Next", "Lantinghei SC";
font-size: 14px;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
}
.wrap{
width: 100%;
height: 600px;
position: absolute;
top: 50%;
margin-top: -300px;
background-color: #333;
overflow: hidden;
-webkit-perspective: 800px;
-moz-perspective: 800px;
}
/*海報樣式*/
.photo{
width: 260px;
height: 320px;
position: absolute;
z-index: 1;
box-shadow: 0 0 1px rgba(0,0,0,.01);
-webkit-transition: all .6s;
}
.photo .side{
width: 100%;
height: 100%;
background-color: #eee;
position: absolute;
top: 0;
right: 0;
padding: 20px;
box-sizing: border-box;
}
.photo .side-front{}
.photo .side-front .image{
width: 100%;
height: 250px;
line-height: 250px;
overflow: hidden;
}
.photo .side-front .image img{
width: 100%;
}
.photo .side-front .caption{
text-align: center;
font-size: 16px;
line-height: 50px;
}
.photo .side-back{}
.photo .side-back .desc{
color: #666;
font-size: 14px;
line-height: 1.5em;
}
/*當前選中的海報樣式*/
.photo_center{
left: 50%;
right: 50%;
margin: 160px 0 0 -130px;
z-index: 999;
}
/*負責翻轉*/
.photo-wrap{
position: absolute;
width: 100%;
height: 100%;
-webkit-transform-style: preserve-3d;
-webkit-transition: all .6s;
}
.photo-wrap .side-front{
-webkit-transform: rotateY(0deg);
}
.photo-wrap .side-back{
-webkit-transform: rotateY(180deg);
}
.photo-wrap .side{
-webkit-backface-visibility: hidden;
}
.photo_front .photo-wrap{
-webkit-transform: rotateY(0deg);
}
.photo_back .photo-wrap{
-webkit-transform: rotateY(180deg);
}
/* 控制按鈕的樣式 */
.nav{
width: 80%;
height: 30px;
line-height: 30px;
position: absolute;
left: 10%;
bottom: 20px;
z-index: 999;
background-color: #fff;
text-align: center;
}
/*控制按鈕的樣式*/
@font-face{
font-family: 'icons';
src: url('turn-arrow.woff') format('woff');
font-weight: normal;
font-size: normal;
}
/*普通樣式*/
.nav .i{
width: 30px;
height: 30px;
display: inline-block;
cursor: pointer;
background-color: #aaa;
text-align: center;
border-radius: 50%;
-webkit-transform: scale(.48);
-webkit-transition: all .5s;
}
.nav .i:after{
content: "\e600";
font-family: 'icons';
font-size: 80%;
display: inline-block;
line-height: 30px;
text-align: center;
color: #fff;
opacity: 0;
}
/*選中樣式*/
.nav .i_current{
-webkit-transform: scale(1);
}
.nav .i_current:after{
opacity: 1;
}
/*背面樣式*/
.nav .i_back{
-webkit-transform: rotateY(-180deg);
background-color: #555;
}
/* 優化樣式 */
.photo{
left: 50%;
top: 50%;
margin: -160px 0 0 -130px;
}
.photo-wrap{
-webkit-transform-origin: 0% 50%;
}
.photo_front .photo-wrap{
-webkit-transform: translate(0px, 0px) rotateY(0deg);
}
.photo_back .photo-wrap{
-webkit-transform: translate(260px, 0px) rotateY(180deg);
}
</style>
?</head>?
?<body onselectstart="return false;">?
? <div class="wrap">?
?
? <div class="photo-wrap">
?
? ?<div class="photo photo_front">?
? ? <div class="side side-front">?
? ? ?<p class="image"><img src="img/2.jpg" /></p>?
? ? ?<p class="caption">2</p>?
? ? </div>?
? ? <div class="side side-back">
? ? <p class="desc">描述的文字</p>?
? ? </div>?
? ?</div>?
? ?
? ?</div>
? </div>?
?</body>
</html>