tags:

views:

378

answers:

4

Is it possible to create vertical text using only CSS, compatible with IE6+?

By vertical I mean

F
O
O

B
A
R
+2  A: 

not today in a browser agnostic way. wait for CSS3

Scott Evernden
+6  A: 

Edited: You can try the following:

p {
  letter-spacing: 1000px;    // more than width of parent 
  word-wrap: break-word;    // seems to work in at least Firefox and IE7+ 
}

This seems to work in Firefox 3.5 and IE7+ (don't have access to IE6 right now). The only thing that is missing from that solution is an extra new line for a space, the result is something like:

F
O
O
B
A
R

jeroen
I think it doesn't work on IE6 I think. An alternative would be to make the container small enough to break the word. Also the word should have spaces between its letters to allow for word breaking cross browser.
voyager
Now it works, the word-wrap was needed...
jeroen
A: 

You can achieve something similar (at least in IE) using this CSS:

.verticaltext {
  writing-mode: tb-rl;
}

But this will rotate the characters by 90 degrees clockwise.

M4N
A: 

This works in IE, but unfortunately not FF:

.verticaltext 
{
    writing-mode: tb-rl;
    filter: fliph flipv;
}
Adnan