Text Overflow Ellipsis

Text Overflow Ellipsis

Hard CSS Typography & Colors 21 views
Explanation Complexity

Problem Statement

Limit a long title to one line with ellipsis.

Input Format

No input.

Output Format

Print the HTML+CSS code in one block.

Constraints

Use white-space, overflow, and text-overflow.

Input / Output Format

Input Format
No input.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use white-space, overflow, and text-overflow.

Examples

Input:
Output:
(HTML+CSS code)

Example Solution (Public)

CSS
<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>meetcode</title>
  <style>
    .title { width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid #eee; padding: 10px; border-radius: 12px; }
  </style>
</head>
<body>
  <div class='title'>meetcode has many small coding questions for daily practice</div>
</body>
</html>

Official Solution Code

<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>meetcode</title>
  <style>
    .title { width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid #eee; padding: 10px; border-radius: 12px; }
  </style>
</head>
<body>
  <div class='title'>meetcode has many small coding questions for daily practice</div>
</body>
</html>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.