0
我試圖展開文本到所有高度的綠色div並居中垂直。這是一個例子:examplecss hml div全高與文本在90°旋轉並居中在一個div
HTML:
<div class="willSlide" id='content'></div>
<div class="willSlide" id='btn'>
<span class="click">CLICK THIS IS A VERY VERY VERY VERY VERY LONG TEXT</span>
<span class="expandedTxt">Expanded! THIS IS A VERY VERY VERY LONG TEXT</span>
</div>
CSS:
#content{
position:fixed;
height:100%;
background:rgb(97, 97, 97);
width:200px;
right:0px;
margin-right: -200px;
}
#btn{
position: fixed;
width: 30px;
height: 100%;
right: 0px;
background: rgb(117, 231, 117);
text-align: center;
padding: 40px 0;
cursor:pointer
}
.click{
display:block;
transform: rotate(-90deg);
}
.expandedTxt{
display:none;
transform: rotate(-90deg);
}
#btn.expanded .expandedTxt{
display:block
}
#btn.expanded .click{
display:none
}
也有一些JQuery的動畫... 什麼錯誤或如何實現這一目標?
是否這樣? http://jsfiddle.net/na89trxh/7/ –