Guest User

Untitled

a guest
Jul 20th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. <div class="container">
  2. <div class="statusColumn"><span>Normal</span></div>
  3. <div class="statusColumn"><a>Normal</a></div>
  4. <div class="statusColumn"><b>Rotated</b></div>
  5. <div class="statusColumn"><abbr>Normal</abbr></div>
  6. </div>
  7.  
  8. .statusColumn b {
  9. writing-mode: tb-rl;
  10. white-space: nowrap;
  11. display: inline-block;
  12. overflow: visible;
  13. transform: rotate(-90deg);
  14. transform-origin: 50% 50%;
  15. }
  16.  
  17. <div id="container">
  18. <something class="element-to-rotate">bla bla bla</something>
  19. </div>
  20.  
  21. <div id="container">
  22. <div class="rotation-wrapper-outer">
  23. <div class="rotation-wrapper-inner">
  24. <something class="element-to-rotate">bla bla bla</something>
  25. </div>
  26. </div>
  27. </div>
  28.  
  29. .rotation-wrapper-outer {
  30. display: table;
  31. }
  32. .rotation-wrapper-inner {
  33. padding: 50% 0;
  34. height: 0;
  35. }
  36. .element-to-rotate {
  37. display: block;
  38. transform-origin: top left;
  39. /* Note: for a CLOCKWISE rotation, use the commented-out
  40. transform instead of this one. */
  41. transform: rotate(-90deg) translate(-100%);
  42. /* transform: rotate(90deg) translate(0, -100%); */
  43. margin-top: -50%;
  44.  
  45. /* Not vital, but possibly a good idea if the element you're rotating contains
  46. text and you want a single long vertical line of text and the pre-rotation
  47. width of your element is small enough that the text wraps: */
  48. white-space: nowrap;
  49. }
  50.  
  51. $(".statusColumn").each(function() {
  52. var $this = $(this),
  53. child = $this.children(":first");
  54. $this.css("minHeight", function() {
  55. return child[0].getBoundingClientRect().height;
  56. });
  57. });
  58.  
  59. transform: rotate(-90deg) translateX(-100%);
  60. transform-origin: top left;
  61.  
  62. <br>
Add Comment
Please, Sign In to add comment