-
-
Save mikedugan/7712767 to your computer and use it in GitHub Desktop.
makes text display vertically in browsers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Works everywere ( IE7+, FF, Chrome, Safari, Opera ) | |
* Example: http://jsfiddle.net/MTyFP/66/embedded/result/ | |
*/ | |
.rotated-text { | |
display: inline-block; | |
overflow: hidden; | |
width: 1.5em; | |
} | |
.rotated-text__inner { | |
display: inline-block; | |
white-space: nowrap; | |
-webkit-transform: translate(50%,0) rotate(90deg); | |
-moz-transform: translate(50%,0) rotate(90deg); | |
-o-transform: translate(50%,0) rotate(90deg); | |
transform: translate(50%,0) rotate(90deg); | |
-webkit-transform-origin: 0 0; | |
-moz-transform-origin: 0 0; | |
-o-transform-origin: 0 0; | |
transform-origin: 0 0; | |
/* IE 9+ */ | |
-ms-transform: none; | |
-ms-transform-origin: none; | |
/* IE 8+ */ | |
-ms-writing-mode: tb-rl; | |
/* IE7 and below */ | |
*writing-mode: tb-rl; | |
} | |
/* This element stretches the parent to be square | |
by using the mechanics of vertical margins */ | |
.rotated-text__inner:before { | |
content: ""; | |
float: left; | |
margin-top: 100%; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="rotated-text"> | |
<span class="rotated-text__inner">Normal</span> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment