4

i have a mail template newsletter here: http://www.newsletter.vendopor.com/m29-04-13/index2.html

But at the end, have a paragraph that contains that text: Por favor, envía este correo a las personas que creas le puede ayudar nuestro...

And this text, go out the paragraph (i have a width 380 attribute in css and keeps going out).

It's at the end of the page

I've searched in google, but can't find the solution

Works fine on Chrome, but in Mozilla (last version) the text is going out.

Thanks a lot for your help

4

3 回答 3

12

您可以使用text-overflow: ellipsis;

div {
    width:200px; 
    overflow:hidden; 
    border:1px solid #f00;
    text-overflow:ellipsis;
    white-space:nowrap; 
}
<div>This is very very long text This is very very long text This is very very long text </div>

祝你好运...

于 2013-04-24T13:33:40.927 回答
7
<?php echo substr('your text',0,500); ?>

打印文本的前 500 个字符

或者当您不想使用 php 并且只想在到达块的末尾时文本消失时添加overflow:hidden;div 块的 css

于 2013-04-24T13:29:30.233 回答
-3

我找到了,这添加到段落中:white-space: normal; 你可以在这里了解一些关于空白的知识:sidar.org/recur/desdi/traduc/es/css/...它现在在 mozilla 中运行良好,谢谢大家!

于 2013-04-28T20:15:58.647 回答