如何使短语中的文本中断?(How to make the text break in phrases? [closed])

编程入门 行业动态 更新时间:2024-10-23 01:44:34
如何使短语中的文本中断?(How to make the text break in phrases? [closed])

我正在建立一个响应式网站。 由于css的范围介于320和480px之间,因此我遇到的问题是文本在单个单词而不是短语中断开。 我不确定这是否可以用css完成。 我认为将需要javascript。

我将尝试绘制正在发生的事情:

它打破了每个字。

------------------------------------------- | phrase one bla bla bla > phrase two bla | | bla > phrase three bla | -------------------------------------------

我需要的是在每个短语之后打破它。 我希望它看起来像这样:

------------------------------------------- | phrase one bla bla bla | | phrase two bla bla > phrase three bla | -------------------------------------------

我在短语之间加了一个符号“>”。 如果符号在线的末尾被消除,那也是很好的。

I'm building a responsive site. Due to the fact that the css has a range between 320 and 480px, I am having an issue that the text is breaking at single words and not at phrases. I am not sure if this can be accomplished with css. I assume that javascript will be required.

I'll attempt to diagram what's happening:

It breaks at each word.

------------------------------------------- | phrase one bla bla bla > phrase two bla | | bla > phrase three bla | -------------------------------------------

What I need is it to break after each phrase. I want it to look like this:

------------------------------------------- | phrase one bla bla bla | | phrase two bla bla > phrase three bla | -------------------------------------------

I have included a symbol ">" between the phrases. It would also be great if the symbol would be eliminated if it is at the end of the line.

最满意答案

在HTML中,在每个短语中,将空格替换为HTML实体  (代表非破坏性的空间):

phrase one bla bla bla phrase two bla bla phrase three bla

短语之间的空格应该是普通(破碎)空间。

In your HTML, within each phrase, replace the spaces with the HTML entity   (which stands for Non-Breaking SPace):

phrase one bla bla bla phrase two bla bla phrase three bla

The spaces between phrases should be ordinary (breaking) spaces.

更多推荐

本文发布于:2023-07-25 19:41:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1265195.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:短语   文本   text   closed   phrases

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!