我正在建立一个响应式网站。 由于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 blaThe spaces between phrases should be ordinary (breaking) spaces.
更多推荐
发布评论