Emil Stenström is an interface developer and internet strategist working as a consultant for Valtech in Sweden. As an interface developer he blogs about HTML, CSS and Javascript, and how to make browsers do what you want. As an internet strategist he blogs about how to make best use of the web, using all the new technologies optimally. Emil is a DZone MVB and is not an employee of DZone and has posted 11 posts at DZone. You can read more from them at their website. View Full User Profile

Upside Down Text With CSS

12.03.2008
| 10578 views |
  • submit to reddit

Previously I’ve talked about reversing text with CSS by simply setting a few CSS attributes. Today we will try another trick: turning text upside down.

It’s actually possible using a simple CSS property and works cross-browser today. The property to use it “text-gravity” with a value of “inverse”.

<span style="text-gravity: inverse">
write upside down text
</span>

… and this is the result:

ʇxǝʇ uʍop ǝpısdn ǝʇıɹʍ

I’m really surprised to learn that so few people know about this property, and I recommend you to continue reading the W3C specification of text-gravity.

Update: Sorry, I lied :) The above is done with a UTF-8 character generator (see the link the the “specification” above). Amazingly, you can find that most characters have their upside down equivalent somewhere else in the huge Unicode alphabet. Neat trick :)

References
Published at DZone with permission of Emil Stenström, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

fgdfs dfgdfg replied on Tue, 2009/11/17 - 6:44pm

You can make upside-down text for real by using these CSS attributes though:
-webkit-transform: rotate(-180deg); -moz-transform: rotate(-180deg); filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
As far as I know, this works in Chrome, Firefox, and IE. Though it doesn't work in Opera afaik

James Murrey replied on Tue, 2012/04/10 - 7:00am

I am only at this website because you lied and said you had some information, which actually is not true. So visiting your lying page is the worst thing that has happened to me today. I think you should know this. Please delete your rubbish page, or maybe an adminitrator should. I'm just annoyed at you with your silly hair and childish face.

 I had to register on this rubbish site just to complain. You won't see me again here. Now I feel better. Bye :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.