color



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


  • color
  • transparent
  • inherit



css/style.css
  • .a {
  •  color: navy;
  • }
  •  
  • .c {
  •  color: rgba(0, 255, 0, 0.5);
  • }
  •  
  • .d {
  •  color: hsl(315, 100%, 50%);
  • }
  •  
  • .e {
  •  color: hsla(315, 100%, 50%, 0.5);
  • }
.a {
 color: navy;
}

.c {
 color: rgba(0, 255, 0, 0.5);
}

.d {
 color: hsl(315, 100%, 50%);
}

.e {
 color: hsla(315, 100%, 50%, 0.5);
}


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">To be or not to be?</p>
  •  <br />
  •  <p class="b">Привет Мир!</p>
  •  <br />
  •  <p class="c">I live in Ukraine.</p>
  •  <br />
  •  <p class="d">I develop a software.</p>
  •  <br />
  •  <p class="e">I must write this story.</p>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("p1").style.color = "#006400";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".b").css({ "color": "rgb(255, 0, 0)" });
  •  });
  • </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">To be or not to be?</p>
  •  <br />
  •  <p class="b">Привет Мир!</p>
  •  <br />
  •  <p class="c">I live in Ukraine.</p>
  •  <br />
  •  <p class="d">I develop a software.</p>
  •  <br />
  •  <p class="e">I must write this story.</p>
  • <script>
  •  /*JavaScript*/
  •  document.getElementById("p1").style.color = "#006400";
  •  /*jQuery*/
  •  $(document).ready(function () {
  •   $(".b").css({ "color": "rgb(255, 0, 0)" });
  •  });
  • </script>
  • </body>
  • </html>