如何在javascript或css中实现字符长度的弹性

How to elasticity of the char length in javascript or css?

本文关键字:字符 实现 javascript css      更新时间:2023-09-26

我有一个样本

<h3>How to elasticity of the char length in javascript or css<h3>
<h3>How to elasticity<h3>

如果字符串很长,如何配置字符串的大小

<h3>How to elasticity of ...<h3>
<h3>How to elasticity<h3>

如何看待

h3 {
    width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* magic happens here */
}