I want to Trim a string Using css . example my string is
"hi google how are you"
I Want to Get output
"hi"
Get first two letter . Using Css is it possible Trim a string .
Although not possible using CSS; but you can get some kind of illusion in ideal condition may be this workaround work for you. I've used here text-overflow: ellipsis;
you can check the DEMO.
<p>hi google how are you</p>
p {
text-overflow: ellipsis; /* IE, Safari (WebKit) */
overflow:hidden; /* don't show excess chars */
white-space:nowrap; /* force single line */
width: 17px; /*This property playing a major role just showing the first 2 letter*/
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With