简体   繁体   English

safari 中的垂直直立文本有微小的空间

[英]Vertical upright text in safari has tiny spaces

When using writing-mode: vertical-lr with text-orientation: upright , all characters are about the same height.当使用writing-mode: vertical-lrtext-orientation: upright时,所有字符的高度大致相同。 However, on Safari, the space character between words becomes very small.但是,在 Safari 上,单词之间的空格字符变得非常小。 Here is a code snippet for demonstration:这是演示的代码片段:

 @import url("https://fonts.googleapis.com/css2?family=Asap&display=swap"); span { font-family: Asap, sans-serif; text-orientation: upright; writing-mode: vertical-lr; -webkit-text-orientation: upright; }
 <span>Hello, World!</span>

On Chrome and Firefox it looks like this:在 Chrome 和 Firefox 上,它看起来像这样:

垂直“你好,世界!”选定空格的文本。

On Safari, however, it looks like this:然而,在 Safari 上,它看起来像这样:

垂直“你好,世界!”选定空格的文本。空格字符很小。

What would be the best way to make the space character the same size on all browsers that works with multiple fonts and font sizes?在使用多种 fonts 和字体大小的所有浏览器上,使空格字符大小相同的最佳方法是什么?

You can try this, instead of using text-orientation: upright;你可以试试这个,而不是使用text-orientation: upright; try just rotating the text using transform: rotate(90deg);尝试使用transform: rotate(90deg);旋转文本

span {
  font-family: Asap, sans-serif;
  transform: rotate(90deg);
}

Then target specific browsers:然后针对特定浏览器:

span {
  font-family: Asap, sans-serif;
  -webkit-transform: rotate(90deg); 
  -moz-transform: rotate(90deg);
  -ms-transform: rotate(90deg);
  -o-transform: rotate(90deg);
  transform: rotate(90deg);
}

Here is an example in a snippet -这是片段中的一个示例 -

 span { transform: rotate(90deg); display: block; position: fixed; text-transform: uppercase; }
 <span>Hello, World!</span>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM