Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个正在本地开发的网站,我需要在某个点打破文本。
我不想使用<br />代码(有人告诉我它被认为是糟糕的 HTML),所以我想找到一种方法来使用 span 类。
<br />
例如:
<p> Text Here. I want a break <span class="break">here</span> </p>它会在跨度内的单词之后中断。
<p> Text Here. I want a break <span class="break">here</span> </p>
有没有办法做到这一点,或者 a 正在使用 br 标记不错的 HTML(如果是这样,我将使用它;但我仍然想知道它是否可能在 CSS 中。)
使用 break 标记 ( <br />) 没有任何问题。但是,如果您觉得需要使用 CSS,请尝试:
.break { display:block; clear:both; }
jsFiddle 示例