前景色

color属性允许你指定元素中文本的颜色。你可以在CSS中采用以下三种方法之一来指定任何颜色

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <style>
            /* color name */
            h1 {
                color: DarkCyan;
            }
            /* hex code */
            h2 {
                color: #ee3e80;
            }
            p {
                color: rgb(100,100,90);
            }
        </style>
    </head>
    <body>
        <div>TODO write content</div>
        <h1>这种方式从组成一种颜色分别需要多少红色,绿色,蓝色的角度来表示颜色。</h1>
        <h2>例如:rgb(100,100,90).</h2>
        <p>这种方式是通过六位十六进制编码(每两位构成一个值,共三个值)分别代表一种颜色中红,绿,蓝的数量,前面加一个#号</p>
    </body>
</html>
原文地址:https://www.cnblogs.com/q2546/p/9417742.html