Skip to content

Instantly share code, notes, and snippets.

@wuliupo
Last active November 18, 2016 03:16
Show Gist options
  • Select an option

  • Save wuliupo/b463988a5d06ffea9b8020d335dc469c to your computer and use it in GitHub Desktop.

Select an option

Save wuliupo/b463988a5d06ffea9b8020d335dc469c to your computer and use it in GitHub Desktop.
CSS ellipsis
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS ellipsis</title>
</head>
<style>
div {
margin: 20px auto;
border: 1px solid #CCC;
width: 200px;
height: 20px;
line-height: 20px;
overflow: hidden;
word-break: break-all;
word-wrap: break-word;
white-space: nowrap;
text-overflow: clip;
text-overflow: ellipsis;
text-overflow: "…";
}
</style>
<body>
<div>longest word: pneumonoultramicroscopicsilicovolcanoconiosis</div>
<div>Overflow behavior at line end Right end if ltr, left end if rtl</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment