I'm just learning CSS: this seems like a simple task, but I spent some time researching and can't make it work:
Say I have a long text line - how do you get all the text to be displayed in one line and with a certain width, but limit what is shown at the end of the line?
.demo {
border: 1px solid red;
white-space: nowrap;
max-width: 100px;
overflow: hidden;
}
<p class="demo">hello this is a string</p>
Run codeHide resultFor example, here it shows the beginning of a line (and cuts off the end), but I need it to show the end (and cut off the beginning).
Any help would be truly appreciated; I can just skip one line. Thank you very much!
source
share