简体   繁体   English

如何让单词环绕在 a 中<span>?</span>

[英]How can I make words wrap around inside a <span>?

I have this code:我有这个代码:

 <div style="max-width: 10rem"> <span>Welcome back (said by a person welcoming you back)</span> </div>

The words show in the span and then flow outside of the 10rem div area.单词显示在跨度中,然后流到 10rem div 区域之外。

Is there a way that I can make the words wrap around and stay inside of the <span> ?有什么方法可以让文字环绕并留在<span>

we use word wrap when there is a long word in a paragraph or span you can do this for wrapping words当段落或跨度中有长单词时,我们使用自动换行,您可以这样做来换行

<span style="word-wrap: break-word;">Welcome back (said by a person welcoming you back)</span>

your current span does not consist of any long word and it's working fine您当前的跨度不包含任何长词,并且工作正常

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

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