Loading

css实现重复渐变的边框

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Carver玩转css</title>
    <style>
        .container {
            padding: 10px;
            background: #fff;
        }

        .card {
            width: 300px;
            margin: 0 auto;
            color: #333;
            font-style: italic;
            line-height: 1.8;
            border-radius: 10px;
            background: repeating-linear-gradient(
                    -45deg,
                    #f3ec78 0px 10px,
                    #af4261 10px 20px,
                    #75adf8 20px 30px,
                    #fff 30px 40px
            ) 0px 20px/200% 200%;
            padding: 3px;
            transition: 1s;
        }

        .card:hover {
            background-position: 0 0;
        }

    </style>
</head>
<body>
<div>
    <div class="card">
        <div class="container">
            hello world
            重复渐变的边框重复渐变的边框
            重复渐变的边框重复渐变的边框
            重复渐变的边框重复渐变的边框
        </div>
    </div>
</div>
</body>
</html>

 

posted @ 2023-09-10 16:02  Carvers  阅读(37)  评论(0)    收藏  举报