Skip to content

Instantly share code, notes, and snippets.

@Alkimisti
Created March 23, 2021 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Alkimisti/80d85d721f91b5521117fc76c9fad0ce to your computer and use it in GitHub Desktop.
Save Alkimisti/80d85d721f91b5521117fc76c9fad0ce to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>text-overflow</title>
<style>
#clip {
white-space: nowrap;
width: 150px;
overflow: hidden;
text-overflow: clip;
border: 1px solid #000000;
}
#ellipsis {
white-space: nowrap;
width: 150px;
overflow: hidden;
text-overflow: ellipsis;
border: 1px solid #000000;
}
#custom {
white-space: nowrap;
width: 150px;
overflow: hidden;
text-overflow: "***";
border: 1px solid #000000;
}
</style>
</head>
<body>
<h2>text-overflow: clip:</h2>
<div id="clip">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Expedita, voluptatum?</div>
<h2>text-overflow: ellipsis:</h2>
<div id="ellipsis">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur, natus.</div>
<h2>text-overflow: "***" (Firefox):</h2>
<div id="custom">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Enim, odio!</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment