我有三個或更多的div,我想旋轉並垂直對齊它們。我試過了,但我沒有找到解決方案。CSS3:多個旋轉的div垂直對齊
的CSS:
.rotation {
float: left;
clear: both;
width:100px;
}
.rotation .container {
float: left;
clear: both;
}
.rotation .rotate {
float: left;
margin-top: 20px;
-ms-transform: rotate(90deg);
/*IE 9*/
-webkit-transform: rotate(90deg);
/*Chrome, Safari, Opera*/
transform: rotate(90deg);
transform-origin: 50% 50% 0;
background: #3c8d37;
color: #fff;
font-family:arial;
}
HTML:
<div class="rotation">
<div class="container">
<div class="rotate">First Text</div>
</div>
<div class="container">
<div class="rotate">Long Text Long Text</div>
</div>
<div class="container">
<div class="rotate">Very Long Text Very Long Text</div>
</div>
</div>
我試圖做這樣的事情:
文本長度可以與文化和我改變想要保持所有的div對齊。那可能嗎?我感謝任何幫助。
不要旋轉單個項目...旋轉整個事情。簡單得多。 – 2014-10-07 14:53:53
謝謝@Paulie_D非常好的主意! – Ragnar 2014-10-07 14:57:14