Sarika Manav
Sarika Manav

Reputation: 11

How to wrap the text in 2 lines on Internet Explorer and firefox?

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

Upvotes: 1

Views: 1904

Answers (2)

Jishnu V S
Jishnu V S

Reputation: 8409

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>

Upvotes: 0

Kranthi
Kranthi

Reputation: 43

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

Upvotes: 0

Related Questions