CSS上解決文字超過div寬度的方法-text-overflow

在hmtl裡,文字如果超過div的寬度,可能會破壞掉原本的排版,可以用overflow跟text-overflow搭配來解決,之前有提過這點,沒想到純css就可以讓超過長度的文字變成...了,很方便,搭配的效果如下,可以試試。

style="text-overflow : clip; overflow : hidden"
Adobe helps businesses thrive in a world where digital media is pervasive

style="text-overflow : ellipsis; overflow : hidden"
Adobe helps businesses thrive in a world where digital media is pervasive

style="text-overflow : ellipsis; overflow : visible"
Adobe helps businesses thrive in a world where digital media is pervasive

W3C上的說明

留言