使用css在文本后添加“。”(句点)

时间:2013-10-01 04:53:26

标签: html asp.net css css-selectors

我创建了一个ASP页面,我在其中显示事件。我使用css在一个项目模板中显示最多3行内容。

我想在文本后面显示3个句点,即:

enter image description here

我在互联网上搜索并找到了使用.after{content:"..."}在文本后添加句点的解决方案,但是这些点放在新行中但是我想得到图像中的确切输出。

我的css是:

        .eventDescription
        {
        height: 45px;
        margin-left: 65px;
        font-size: 15px;            
        line-height: 1.5em;
        overflow: hidden;
        text-align: justify;
        line-height: 15px;
        padding-top: 10px;
        width: 220px;            
        }  

1 个答案:

答案 0 :(得分:4)

:after伪与content属性

一起使用

Demo


您可以分别使用font-sizeletter-spacing属性控制点间距或大小。

Demo 2


根据您的语法,您正在使用.after{content:"..."},因此首先您需要在此处为​​该元素分配类,因此它将为<p class="after">,您还需要添加:after伪到你的.after

.after:after {
   content: "...";
}
  

注意:使用:after,默认情况下,内容将为inline   要应用您需要使用inline-block;的边距或填充,旧的IE版本也不会尊重此属性。

有关:after

的浏览器支持的详细信息