font-weight



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


  • normal
  • bold
  • bolder
  • 100 200 300 400 500 600 700 800 900
  • inherit



css/style.css
  • .a {
  •  font-weight: normal;
  • }
.a {
 font-weight: 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!</p>
  •  <br />
  •  <p id="p1">Hello World!</p>
  •  <br />
  •  <p class ="b">Hello World!</p>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("p1").style.fontWeight = "bold";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".b").css({ "font-weight": "900" });
  •  });
  • </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!</p>
  •  <br />
  •  <p id="p1">Hello World!</p>
  •  <br />
  •  <p class ="b">Hello World!</p>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("p1").style.fontWeight = "bold";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".b").css({ "font-weight": "900" });
  •  });
  • </script>
  • </body>
  • </html>