0

I need to make a anchor / link contain within its div / li and multiline.

Heres a JSFiddle to show what I mean http://jsfiddle.net/x5nPx/

<div class="locked-content">
  <ul>
    <li>
      <a>www.example.com/39083904398980/93943430943098438094/test/example/long/link/here</a>
    </li>
  </ul>
</div>

<style>
  .locked-content {
    background: purple;
    width: 200px;
    height: 400px;
  }
</style>

Cheers

ptimson
  • 5,533
  • 8
  • 35
  • 53

2 Answers2

2

Fiddle
You have to use the following css property-

word-wrap:break-word;
svineet
  • 1,859
  • 1
  • 17
  • 28
1
-ms-word-break: break-all;
     word-break: break-all;

     /* Non standard for webkit */
     word-break: break-word;

-webkit-hyphens: auto;
   -moz-hyphens: auto;
        hyphens: auto;

Via: http://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/

KTastrophy
  • 1,739
  • 15
  • 23