<style> .text { display: block; width: 100px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } </style> <span class="text">Hello world this is a long sentence</span>