How do you align 270deg rotated text to top left?

前端 未结 2 1535
Happy的楠姐
Happy的楠姐 2021-02-07 10:07

This should be a very simple problem you would think. I have a box with some title text that I want to rotate -90 degrees. I would like it to be absolutely positioned so that th

2条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 10:39

    Can also work without right:100% Just rotate 270 deg around left top and then translate it back at new 100% width.

    transform: rotate(-90deg) translate(-100%, 0);
    transform-origin: 0 0;
    

    http://jsfiddle.net/zW7SP/

提交回复
热议问题