如何仅使用 CSS 创建垂直文本?

发布于 2024-08-05 04:54:37 字数 91 浏览 3 评论 0原文

是否可以仅使用 CSS 创建垂直文本,并兼容 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

静谧 2024-08-12 04:54:37

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

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

这似乎适用于 Firefox 3.5 和 IE7+(目前无法访问 IE6)。该解决方案唯一缺少的是一个额外的空格换行,结果类似于:

F


B
一个

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

冰火雁神 2024-08-12 04:54:37

如今,以与浏览器无关的方式实现这一点是不可能的。等待CSS3。

Today it is not possible in a browser agnostic way. Wait for CSS3.

﹏半生如梦愿梦如真 2024-08-12 04:54:37

这在 IE 中有效,但不幸的是在 FF 中无效:

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

This works in IE, but unfortunately not FF:

.verticaltext 
{
    writing-mode: tb-rl;
    filter: fliph flipv;
}
假情假意假温柔 2024-08-12 04:54:37

您可以使用此 CSS 实现类似的功能(至少在 IE 中):

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

但这会将字符顺时针旋转 90 度。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文