简体   繁体   English

CSS文本分词符溢出

[英]CSS Text word break With overflow

Hey I want To make my text to break word and get only the first break word like make the the second break word and the rest to be hidden. 嘿,我想使我的文本成为断行单词,而只使第一个断行单词成为第二个断行单词,其余的隐藏起来。

This is the site for the code: here 这是代码的站点: 这里

This is the part i want to be edit. 这是我要编辑的部分。 ignore the other code in the jsfiddle. 忽略jsfiddle中的其他代码。

.rpwe-block a{
color:#9d6745;
text-decoration:none;
clear: both;
text-overflow:ellipsis;
 overflow: hidden; white-space: nowrap;
}

I just want you to help me in editing this code I have. 我只希望您帮助我编辑此代码。

For the overflow: hidden to work the element would need a width (by default a tags are inline elements) 对于上overflow: hidden以起作用的元素将需要一个宽度(默认情况下a标记为内联元素)

.rpwe-block a{
color:#9d6745;
text-decoration:none;
clear: both;
text-overflow:ellipsis;
overflow: hidden; white-space: nowrap;
width: 100%;
display: block;
}

Get rid of white-space: no-wrap from .rpwe-block a and add the following: 摆脱white-space: no-wrap .rpwe-block a white-space: no-wrap并添加以下内容:

.rpwe-title{
  height: 14px;
  display: block;
  overflow: hidden;
}

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

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