CSS 3 · Positioning, effects and animation
Truncate text with an ellipsis
Cut off long single-line text with three dots.
.title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
More positioning, effects and animation commands
- Stick an element while scrolling
- Cover the parent
- Crop an image to fit its box
- Limit text to a number of lines
- Animate a change smoothly
- Create an animation
All positioning, effects and animation commands · CSS 3 cheatsheet