Donnerstag, 8. Dezember 2011

Strings kürzen mit CSS

Man kann Strings kürzen und "..." anhängen auch automatisch mit CSS:

.ellipsis {
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
 -o-text-overflow: ellipsis;
 -moz-binding: url('assets/xml/ellipsis.xml#ellipsis');
}
 
Geht im alten Firefox zwar nicht, aber der ist nicht mehr so verbreitet.
Quelle: http://mattsnider.com/css/css-string-truncation-with-ellipsis/


Like it? Share it! Flattr this

Keine Kommentare: