Tuesday 20 May 2014

Text overflow ellipsis

Adds an ellipsis if the text is longer than the available space.

<html lang="en">
<head>
<meta charset="UTF-8">
<style>
p {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
Width: 150px;
}
</style>
</head>
<body>
<p>This text is longer than the space allows</p>
</body>
</html>

No comments:

Post a Comment