line-height



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


  • normal
  • number
  • height
  • %
  • inherit



css/style.css
  • .a {
  •  line-height: normal;
  • }
.a {
 line-height: 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>
  •  <p class="a">Hello World!<br />To be or not to be?</p>
  •  <hr />
  •  <p id="p1">Hello World!<br />To be or not to be?</p>
  •  <hr />
  •  <p id="p2">Hello World!<br />To be or not to be?</p>
  •  <hr />
  •  <p id="p3">Hello World!<br />To be or not to be?</p>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("p1").style.lineHeight = "3";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $("#p2").css({ "line-height": "10px" });
  •   $("#p3").css({ "line-height": "150%" });
  •  });
  • </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>
  •  <p class="a">Hello World!<br />To be or not to be?</p>
  •  <hr />
  •  <p id="p1">Hello World!<br />To be or not to be?</p>
  •  <hr />
  •  <p id="p2">Hello World!<br />To be or not to be?</p>
  •  <hr />
  •  <p id="p3">Hello World!<br />To be or not to be?</p>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("p1").style.lineHeight = "3";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $("#p2").css({ "line-height": "10px" });
  •   $("#p3").css({ "line-height": "150%" });
  •  });
  • </script>
  • </body>
  • </html>