0

This code displays a line of code and then gives three dots. example:

The Alsos Mission was an Allied unit formed to ...

I want two or three lines and then three points

example:

  The Alsos Mission was an Allied unit formed to 
  investigate Axis scientific developments ...

div{
  width : 500px;
  overflow:hidden;
  display:inline-block;
  text-overflow: ellipsis;
  white-space: nowrap;
}
<div>
    The Alsos Mission was an Allied unit formed to investigate Axis scientific developments, especially nuclear, chemical and biological weapons, as part of the Manhattan Project during World War II. Colonel Boris Pash, a former Manhattan P
</div>
Temani Afif
  • 245,468
  • 26
  • 309
  • 415
Rasoul
  • 97
  • 1
  • 2
  • 8

1 Answers1

-2

Maybe it can work!

div { max-width: 75ch; //characters }

div:after { content: "..." }

  • 2
    `max-width` applies a constraint on the container, not on the text in it. Therefore this doesn't work. Please consider trying out your answers before posting. – Hubert Grzeskowiak Mar 25 '18 at 12:12