word-wrap



значения свойства:


  • normal
  • break-word



css/style.css
  • div {
  •  width: 100px;
  •  border: 1px solid #8E8E8E;
  • }
  •  
  • .a {
  •  word-wrap: normal;
  • }
div {
 width: 100px;
 border: 1px solid #8E8E8E;
}

.a {
 word-wrap: normal;
}


index.html
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <link href="css/style.css" rel="stylesheet" />
  •  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  • </head>
  • <body>
  •  <div class="a">heeeeellowoooorld</div>
  •  <br />
  •  <div id="div1">heeeeellowoooorld</div>
  •  <br />
  •  <div class="b">heeeeellowoooorld</div>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("div1").style.wordWrap = "break-word";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".b").css({ "word-wrap": "break-word" });
  •  });
  • </script>
  • </body>
  • </html>
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  •  <link href="css/style.css" rel="stylesheet" />
  •  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  • </head>
  • <body>
  •  <div class="a">heeeeellowoooorld</div>
  •  <br />
  •  <div id="div1">heeeeellowoooorld</div>
  •  <br />
  •  <div class="b">heeeeellowoooorld</div>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("div1").style.wordWrap = "break-word";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".b").css({ "word-wrap": "break-word" });
  •  });
  • </script>
  • </body>
  • </html>