- index.html
- style.css
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Overflowing Text</title>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
</head>
<body>
<p>Muffin woke on up in his cat bed very early that morning. The day promised to be eventful. Due to this, he decided to work out on his chin-up bar. The cat eventually tired himself out exercising, and he decided to relax a bit and watch TV. Having regained his strength, the cat went about his usual business of making a mess. However, he was caught in the act.</p>
</body>
</html>
CSS
body {
background: url("bokeh.jpg") no-repeat 50% 0;
color: #333333;
font-size: 12px;
font-family: "Arial", sans-serif;
}
p {
margin: 50px auto;
padding: 20px;
width: 50%;
background-color: rgba(240, 240, 240, 0.85);
font-size: 16px;
line-height: 22px;
}
You’ve gone to a different page
Goalscompleted
0
- Assign the non-breaking spaces
white-space: nowrap
andoverflow: hidden
to the paragraph, - and then assign the
text-overflow
text-overflow mode with the valueellipsis
.
Comments