如何使用CSS创建垂直文本? [英] How to create vertical text using only CSS?

查看:125
本文介绍了如何使用CSS创建垂直文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能只使用CSS创建垂直文本,与IE6 +兼容?



按垂直方向表示

  F 
O
O

B
A
R


解决方案

已编辑:您可以尝试以下操作:

  p {
letter-spacing:1000px; //超过父的宽度
word-wrap:break-word; //似乎至少在Firefox和IE7 +中工作
}

Firefox 3.5和IE7 +(现在没有访问IE6)。该解决方案中唯一缺少的是一个空格的新行,结果如下:



F

O

O

B

A

R


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

By vertical I mean

F
O
O

B
A
R

解决方案

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

这篇关于如何使用CSS创建垂直文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆