开发者

Is it possible to make text display vertically with css?

L
i
k
e

t
h
i
s

Can you answer by a demo?

For those of you don't know what kind of effect I 开发者_C百科need,see here(this one only works in IE, which is basically what I want).

I don't need the text to rotate. Only vertical is necessary!

effect image:

Is it possible to make text display vertically with css?

(source: 51hired.com)


A solution for FireFox (and possibly other browsers) here: http://bytes.com/topic/javascript/answers/721811-solution-display-text-rotated-90-vertically-firefox-css

An IE-specific solution here:
http://www.ssi-developer.net/css/vertical-text.shtml


You could try to set a fixed, small width for the container. If you print your text interleaving spaces, then they should show one below the other.


Nope, but a series of line breaks (<br> elements) should do the trick.


This is simplest way by adding space between letters and width 1px

css:

p{width:1px;}

HTML

<p>L i k e t h i s</p>

Now output will come as you like

L
i
k
e

t
h
i
s


The fastest route to the finish line will be to craft an image with the text laid out the way you want. Be sure to add an alt attribute to its img element wherever used, so search engines can index it properly.

By the way, that's an issue with the markup-based solutions: search engines may not match words in the label if their letters are separated by tags.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜