2013-10-28 50 views
0

我有<aside></aside>标签内的文字,现在正出现这样如何对齐文本垂直

This is the text in <aside> 

我想使它看起来垂直这样

T 
h 
i 
s 

i 
s 

t 
h 
e 

t 
e 
x 
t 

我用这CSS

代码:

aside { 
    background: none repeat scroll 0 0 #475E80; 
    height: 690px; 
    position: relative; 
    width: 20px; 
    text-align:bottom; 
} 

我该怎么做?

+0

有作为'的text-align没有这样的事:bottom'。 – matewka

+0

你可以创建小提琴吗? – Roopendra

回答

3

尝试添加word-wrap属性。你的CSS应该是这样的:

aside { 
    background: none repeat scroll 0 0 #475E80; 
    height: 690px; 
    position: relative; 
    width: 0; 
    word-wrap: break-word; 
} 

下面是一个例子:http://jsfiddle.net/CkAFs/1/

你也可以使用word-break: break-all但上述方案是通过浏览器稍微更好的支持。以下是参考文献:http://caniuse.com/#search=word-(请注意,overflow-wrap属性是word-wrap的别名)。

3

这是一招

aside { 
    width: 1px; 
    word-break: break-all; 
} 

演示:http://jsfiddle.net/zu8QQ/

你可以用你的asidediv如果这个代码搞砸了你的设计。