css样式的颜色表达方式+彩虹小人

css样式的颜色表达方式+彩虹小人

css样式的颜色表达方式有三种。
第一种就是直接用英文的颜色来表达。
第二种就是通过16进制来表示,具体的颜色是什么样的代码,请自行解决,我也不知道,我是通过在火狐上的吸色管或者ps的吸色管获取。具体方式请百度一下。
第三种是通过rgb数值来表示。
代码如下:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .yingwen{
            color:red;
        }
        .shuzizifu{
            color: #904425;
        }
        .rgbasd{
            color:rgb(53, 50, 205);
        }
    </style>
</head>

<body>
    <div class="yingwen">这是第一种颜色的表达方式</div>
    <div class="shuzizifu">这是第二种颜色的表达方式</div>
    <div class="rgbasd">这是第三种颜色的表达方式</div>
</body>
</html>

效果如下:
在这里插入图片描述
彩虹小人:这个是我自己做的。
代码参上:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>七彩</title>
    <style>
        .qicai{
            width: 550px;
            height: 250px;
            overflow: hidden;
            position: relative;
            margin: 150px auto;
        }
        .hongse{
            width: 500px;
            height: 500px;
            border: 17px #FF0000  solid;
            border-radius: 50%;
            position: absolute;
        }
        .chengse{
            width: 450px;
            height: 450px;
            border: 17px #FF7F00 solid;
            border-radius: 50%;
            position: absolute;
            top: 20px;
            left: 25px;
        }
        .huangse{
            width: 410px;
            height: 450px;
            border: 17px #FFFF00  solid;
            border-radius: 50%;
            position: absolute;
            top: 40px;
            left: 45px;
        }
        .lvse{
            width: 370px;
            height: 450px;
            border: 17px #00FF00  solid;
            border-radius: 50%;
            position: absolute;
            top: 62px;
            left: 65px;
        }
        .qingse{
            width: 330px;
            height: 450px;
            border: 17px #00FFFF  solid;
            border-radius: 50%;
            position: absolute;
            top: 82px;
            left: 84px;
        }
        .lanse{
            width: 285px;
            height: 450px;
            border: 17px #0000FF  solid;
            border-radius: 50%;
            position: absolute;
            top: 105px;
            left: 106px;
        }
        .zise{
            width: 250px;
            height: 450px;
            border: 17px #8B00FF  solid;
            border-radius: 50%;
            position: absolute;
            top: 125px;
            left: 125px;
        }
        .tou{
            border: 5px solid #000000;
            height: 20px;
            width: 20px;
            border-radius: 50%;
            position: absolute;
            top: 150px;
            left: 250px;
        }
        .shenti{
            border: 5px solid #000000;
            height: 30px;
            width: 20px;
            position: absolute;
            top: 180px;
            left: 250px;
        }
        .zuoshou{
            border-right: 5px solid #000000;
            height: 30px;
            width: 20px;
            position: absolute;
            top: 185px;
            left: 223px;
        }
        .youshou{
            border-right: 5px solid #000000;
            height: 30px;
            width: 20px;
            position: absolute;
            top: 185px;
            left: 262px;
        }
        .zuojiao{
            border-right: 5px solid #000000;
            height: 20px;
            width: 20px;
            position: absolute;
            top: 225px;
            left: 235px;
        }
        .youjiao{
            border-right: 5px solid #000000;
            height: 20px;
            width: 20px;
            position: absolute;
            top: 225px;
            left: 250px;
        }
    </style>
</head>
<body>
    <div class="qicai">
        <div class="hongse"></div>
        <div class="chengse"></div>
        <div class="huangse"></div>
        <div class="lvse"></div>
        <div class="qingse"></div>
        <div class="lanse"></div>
        <div class="zise"></div>
        <div class="xiaoren">
            <div class="tou"></div>
            <div class="shenti"></div>
            <div class="zuoshou"></div>
            <div class="youshou"></div>
            <div class="zuojiao"></div>
            <div class="youjiao"></div>
        </div>

    </div>
</body>
</html>

效果如下:
在这里插入图片描述
有兴趣的可以去敲敲。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值