transform:rotate(-90deg)创建不需要的空间

时间:2016-08-13 21:30:20

标签: css3 css-transforms

我正在使用CSS3的transform属性。它在旋转后在div的左侧创建空间。继承我的JSfiddle

所以想要一些代码:

<div>
   Maglevboard
</div>

<style>
   div {
     font-size:5em;
     transform:rotate(-90deg);
     display:inline-block;
   }
</style>

1 个答案:

答案 0 :(得分:3)

您可以通过添加翻译并使用正确的public class Puppy { public Puppy(String name) { // This constructor has one parameter, name. System.out.println("Passed Name is :" + name ); } public static void main(String [] args) { // Following statement would create an object myPuppy Puppy myPuppy = new Puppy( "tommy" ); } } 来解决此问题。我想你想要

&#13;
&#13;
transform-origin
&#13;
div {
  font-size: 5em;
  transform-origin: 100% 0;
  transform: translateX(-100%) rotate(-90deg);
  display: inline-block;
}
&#13;
&#13;
&#13;