我一直在試圖創造翻轉卡的效果,但我似乎無法得到它,卡翻轉,但相同的內容是在卡的另一面(除了它是相反的),我無法弄清楚如何用新內容替換它。CSS:翻牌效果?
.container {
width: 100%;
height: 800px;
position: relative;
top: -80px;
left: 10px;
}
.box {
border: 1px solid #d3d3d3;
height: 270px;
width: 250px;
position: relative;
float: left;
margin: 10px;
border-radius: 5px;
background-color: #bfd4d9;
transition: all .5s ease;
transform-style: preserve-3d;
perspective: 700;
}
.box:hover {
transform: rotateY(180deg);
}
.content-header {
width: 100%;
height: 90px;
background-color: #638ca6;
border-radius: 5px 5px 0px 0px;
z-index: -10;
}
.content-body {
position: relative;
top: 10px;
left: 12px;
width: 90%;
height: 100px;
border-radius: 10px;
background-color: white;
font-family: 'Oxygen', sans-serif;
}
.body-text {
position: relative;
margin: 5px;
}
.posts-whim-header-pic {
z-index: 10;
position: relative;
left: 10px;
top: 5px;
border-radius: 10px;
}
.posts-whim-header-name {
width: 180px;
position: relative;
top: -70px;
left: 75px;
color: white;
font-size: 20px;
font-family: 'Oxygen', sans-serif;
}
<div class="container">
<div class="box">
<div class="content">
<div class="content-header">
<div class="header-pic">
<img src="/assets/profile.jpg" />
</div>
<div class="header-name">
</div>
</div>
<div class="content-body">
<div class="body-text">
</div>
</div>
哦,請把它放在jsFiddle! – frenchie 2015-02-23 23:43:24
與你的HTML你不應該期望更多。如果你想在後面添加不同的內容,你需要添加另一個div(例如:div body-text和div body-text-b) – 2015-02-24 00:26:54
也許它會是有用的 - http://davidwalsh.name/css-flip http: //desandro.github.io/3dtransforms/docs/card-flip.html – DonSinDRom 2015-02-24 08:53:39