Работает только для текста в 1 строку (с white-space:nowrap;).
Пример на less:
article p{
display:none;
&:first-child{
display:block;
white-space:nowrap;
text-overflow:ellipsis;
overflow:hidden;
}
}
.fading{
max-height:100px;
overflow:hidden;
margin-top:-20px;
}
.fading:before{
content:"";
display:block;
height:20px;
position:relative;
top:80px;
background-image:linear-gradient(to bottom,rgba(255,255,255,0),#ffffff 75%);
}
http://habrahabr.ru/post/241485/
article ul,article ol{
list-style-type:none;
counter-reset:num;
margin:0 0 20px 0;
}
article ul li,article ol li{
list-style-type:none;
padding-left:20px;
margin-bottom:4px;
}
article ul li:before,article ol li:before{
color:#ffffff;
background:#ff9300;
border-radius:50%;
padding:0 5px;
text-align:center;
}
article ul li:before{
content:"•";
}
article ol li:before{
content:counter(num);
counter-increment:num;
}
LESS:
.article{
ul,ol{
list-style-type:none;
counter-reset:num;
margin:0 0 20px 0;
li{
list-style-type:none;
padding-left:20px;
margin-bottom:4px;
position:relative;
&:before{
position:absolute;
top:0;
left:0;
color:@color_link;
font-weight:600;
}
}
}
ul li:before{
content:"•";
}
ol li:before{
content:counter(num) ". ";
counter-increment:num;
}
}
Для того чтобы учитывался атрибут start у ol:
$('article ol').each(function(){
var start=parseInt($(this).attr('start'));
if(start>0){
$(this).css('counter-reset','num '+(start-1));
}
});