我有 2 个“跨度”文本块,我想使用 display: inline 将其“合并在一起”。但是,我希望无论浏览器大小如何,行高都保持一致。对于字体大小,我使用“vw”单位,因为我希望它根据浏览器宽度进行缩放。
https://jsfiddle.net/darrengates/jpLaf683/
当以大尺寸(例如1200px)查看时,文本看起来不错,即:
this is the first block this is the first block this is the first block
this is the first block this is the first block this is the first block
this is the first block this is the first block this is the first block
this is the first block this is the second block... (etc.)
Run Code Online (Sandbox Code Playgroud)
然而,当浏览器的尺寸调整到非常小的尺寸(例如500px)时,行之间的间距开始看起来非常大。事实上,行与行之间似乎有一整行空间,例如:
this is the first block this is the first block this is the first block …Run Code Online (Sandbox Code Playgroud)