现在我正在使用多个标题标签和一个 css 类来实现下图所示的效果,有没有办法通过只使用一个标题/行和 css 来实现这一点?
当前代码:
<h2 class="heading">Hi guys, How can i achieve this effect using just a single</h2>
<div class="clearfix"></div>
<h2 class="heading">line of text and css. Right now i am using</h2>
<h2 class="heading">multiple <h2> tags and a css class to achieve this effect.</h2>
<h2 class="heading">Is it possible to achieve this only with css or do i have to use Javascript as well?</h2>
预期代码
<h2 class="heading">Hi guys, How can i achieve this effect using just a single line of text and css. Right now i am using multiple <h2> tags and a css class to achieve this effect. Is it possible to achieve this only with css or do i have to use Javascript as well?</h2>
在我看来,这个的主要问题是,如果不减小我不想要的字体大小、填充等,我就无法让它响应。
即使我让它具有响应性,我也无法在不使用其他标签或 JavaScript 的情况下在任何我想要的地方添加换行符。
你们是如何解决这个问题的?