在单词之间的空白处的换行符后更改字体大小 [英] Change the font size after break line on white space between words

查看:79
本文介绍了在单词之间的空白处的换行符后更改字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此解决方案中,我找到了解决方案如何在单词之间的空白处换行,这非常有用:在单词之间的空白处折线

I found the solution how to break line on white space between words in this solution which is very helpful: Break line on white space between words

.test{
text-align:center;
}
h1{
word-spacing:9999px;
}

<div class="test">
<h1>split this</h1>
</div>

但是,我可以在换行后更改CSS中的字体大小吗???下面的例子:示例

However, can do I change the font size in css after break the line??? example below: Example

推荐答案

是的,可以将第一行作为目标以增大其大小:

Yes you can, target the first line to make its size bigger:

.test {
  text-align: center;
  font-size:8px;
}
.test:first-line {
  font-size:40px;
}

h1 {
  word-spacing: 9999px;
}

<div class="test">
  <h1>split this</h1>
</div>

这是使用 word-spacing

.test {
  width:min-content;
  margin:auto;
  text-align: center;
  font-size:8px;
}
.test:first-line {
  font-size:40px;
}

<div class="test">
  <h1>split this</h1>
</div>

这篇关于在单词之间的空白处的换行符后更改字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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