其他分享
首页 > 其他分享> > This is 第三天

This is 第三天

作者:互联网

今天继续学习了一些特效

1.shadow:阴影(盒阴影和文字阴影)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>shadow</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            background-color: tomato;
            /* box-shadow: 横向偏移量 纵向变异量 模糊距离 阴影颜色; */
            box-shadow: 100px 100px 50px greenyellow;
        }
        p {
            margin-top: 150px;
            font-size: 40px;
            text-shadow: 1px 1px 2px gold;
        }
    </style>
</head>
<body>
    <!-- 盒子阴影  文字阴影 -->
    <div></div>
    <p>醉后不知天在水,满船清梦压星河</p>
</body>
</html>

效果图 

 2.gradient:渐变(镜像渐变和线性渐变)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>gradient</title>
    <style>
        .d1 {
            width: 300px;
            height: 300px;
            background-color: tomato;
            /* 渐变不是属性,是值,作为图片使用 */
            background-image: -webkit-linear-gradient(45deg, gold, greenyellow, pink);
            background-image: -moz-linear-gradient(45deg, gold, greenyellow, pink);
            background-image: linear-gradient(45deg, gold, greenyellow, pink);
        }
        .d2 {
            width: 300px;
            height: 300px;
            background-color: tomato;
            background-image: -webkit-radial-gradient(center bottom, cyan, skyblue, plum);
            background-image: radial-gradient(center bottom, cyan, skyblue, plum);
        }
        .d3 {
            width: 700px;
            height: 300px;
            background-color: cyan;
            background-image: -webkit-radial-gradient(center bottom, white 30%,plum 30%, plum 35%, 
                                                                     deepskyblue 35%, deepskyblue 40%,
                                                                     cyan 40%, cyan 45%, 
                                                                     greenyellow 45%, greenyellow 50%, 
                                                                     gold 50%, gold 55%, 
                                                                     orange 55%, orange 60%, 
                                                                     tomato 60%, tomato 65%,white 65%);
        }
    </style>
</head>
<body>
    <div class="d1"></div>

    <div class="d2"></div>

    <div class="d3"></div>
</body>
</html>

效果

 3.示例:滑动解锁高亮实现

耶!期待明天!!

标签:greenyellow,gold,gradient,image,第三天,300px,background
来源: https://blog.csdn.net/m0_48604160/article/details/121383116