codegurukool.com · Free coding tutorials & online compiler

Home › CSS Tutorial › CSS text effects

CSS text effects

Wrapping, overflow and writing.

text-overflow:ellipsis needs overflow:hidden and white-space:nowrap. word-wrap breaks long words.

Example code

<style>.e{width:150px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border:1px solid #888}</style>
<div class='e'>This sentence is too long for the box</div>

Run this code in the online editor

← CSS shadowsCSS 2D transforms →