ograniczenie wyświetlonego tekstu

uzyskanie ograniczonej ilości wyrazów w jednolinikowym polu tekstowym:

#test {
    width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid #36D7B7;
}

<div id="test">This is some long text that will not fit in the box</div>

 

This is some long text that will not fit in the box