1

I am wrapping the text in 2 lines . On Google Chrome it's wrapping in 2 lines using the code overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-width: 100%; white-space: normal;

But this code is not working on Internet Explore and Firefox.

Please help me

2
  • can you update your code in fiddle
    – Jishnu V S
    Dec 6, 2016 at 9:16
  • in css :.unitAddressList ul li>div.address{width:11%; margin-right: 1%; margin-top: 8px;overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-width: 100%; white-space: normal; text-overflow: ellipsis; line-height: 20px;} Dec 6, 2016 at 12:14

2 Answers 2

0

Have your used word-wrap? Try this. Hope this helps

1
  • Yes Kranthi , but word wrap is not supporting IE-11 and FF Dec 6, 2016 at 8:22
0

can you copy paste this code to your html page ,this one worked for me , text will wrap all broswers

.main_box {
    float:left;
    height: 200px;
    width: 200px;
    position:relative;
}
.main_box p {
    word-wrap: break-word;
}
<div class="main_box">
   <p>jasdlfjlasjdfsajdfjsadfjlsajdflsjdfjsldfjlsjdflsjdfljsadlfjsldjflsajdflasjdfjsaldj</p>
</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.