在CSS中打破问题

时间:2014-02-04 09:40:37

标签: html line break

我有一个具有以下结构的HTML页面

    <div class="cont">
    <ul class="=slides" id="slider2">
<li id="slides1_s0" class="slides1_on" 
style="display: block; float: left; position: relative; opacity: 1; z-index: 2; -webkit-transition: opacity 300ms ease-in-out; transition: opacity 300ms ease-in-out;">

<span id="stateLabel_22" 
style="font-size:15px;line-height:25px;">
Josef  is the Network Administrator in an organization. The organization is looking at upgrading all of its machines from Windows XP to Windows 7. Many of the managers are concerned that their Windows XP applications won ’ t be compatible with Windows 7. Which Windows 7 feature can you use to assure the managers that all of their Windows XP applications will continue to work?

</span>

</li>
</ul>
</div>

我的问题是我已将&nbsp;存储在数据库中,并绑定到控件。 在以“约瑟夫是......”而不是空格&nbsp;开头的句子中没有。 由于这个原因,我的文字显示为长文本,因此我将word-break: break-all;应用于ul类。

现在的问题是,无论这个词是什么,我的文本都会破碎。它显示为

Josef  is the Network Administrator in an organization. The organization is looking at upgrading al
l of its machines from Windows XP to Windows 7. Many of the managers are concerned that the
ir Windows XP applications

我该如何解决?请帮忙

提前感谢你

SAJ

1 个答案:

答案 0 :(得分:1)

在CSS中调用span id并调用以下CSS

#span_id { white-space:nowrap; }