Reputation: 2534
Let's say I have this text:
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
And I want to display it with specified width and line count(3) like that:
aaaaaaaa
aaaaaaaa
aaaaa...
How can I achieve this?
Upvotes: 0
Views: 724
Reputation: 84
Html Code:
<div class="parent">
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabdbdbdfbdbdbdfbdbdsb
</div>
Css Code:
.parent{width:100px;word-break:break-all;}
Jsfiddle:-
https://jsfiddle.net/Dhavalr/apzy68vp/1/
Upvotes: 1
Reputation: 538
css:
<style>
p.text {
/* your costume with & height*/
width: 11em;
max-height: 3.6em;
line-height: 1.8em;
border: 1px solid #000000;
word-wrap: break-word;
}
</style>
Upvotes: 1