0
Do you know the code for this problem?
I dont know how to descrip my question so i just use that. back to the main question, i want to make every title on my blog just two line, if the title is still not enough for two line the css will break it automaticly. Just like every title video of youtube mobile version. i already try with this code "white-space:nowrap;text-overflow:ellipsis;overflow:hidden" or white-space:pre/pre-line/pre-wap but its still doesn't work. do you know the right code is? sorry for my bad english.
3 Respostas
0
Have you tried white-space:pre; ?
0
i already haved, and still doesnt work
0
if u r doing it in CSS you might get browser incompatibility issue
try this with JavaScript its much easier
ex
<h1 id="h1">sdhhhjjfdckkitf and so on<\h1>
var h1 = document.getElementById('h1').innerHTML;
var newh1 = h1.substring (0,50);
h1.innerHTML=newh1+'...';
I have not tested this code but it should work fine.