cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <svg viewBox="0 0 200 200">
    <defs>
        <!-- Разноцветный градиент -->
        <linearGradient id="gradient--colors"
            x1="0" y1="100%"
            x2="100%" y2="0">
            <stop offset="0%"
                stop-color="dodgerblue"/>
            <stop offset="50%"
                stop-color="fuchsia"/>
            <stop offset="100%"
                stop-color="yellow"/>
        </linearGradient>

        <!-- Градиент прозрачности разноцветного слоя -->
        <radialGradient id="gradient--colors-transparency"
            fx="25%" fy="25%">
            <stop offset="0%"
                  stop-color="black"/>
            <stop offset="30%"
                  stop-color="black"
                  stop-opacity=".2"/>
            <stop offset="97%"
                  stop-color="white"
                  stop-opacity=".4"/>
            <stop offset="100%"
                  stop-color="black"/>
        </radialGradient>

        <!-- Маска прозрачности разноцветного слоя -->
        <mask id="mask--colors-transparency">
            <rect fill="url(#gradient--colors-transparency)"
              width="100%" height="100%"></rect>
        </mask>

        <!-- Градиент для прозрачности -->
        <radialGradient id="gradient--bw-light" fy="10%">
            <stop offset="60%"
                  stop-color="black"
                  stop-opacity="0"/>
            <stop offset="90%"
                  stop-color="white"
                  stop-opacity=".25"/>
            <stop offset="100%"
                  stop-color="black"/>
        </radialGradient>

        <!-- Маска для нижнего отражения -->
        <mask id="mask--light-bottom">
            <rect fill="url(#gradient--bw-light)"
                width="100%" height="100%"></rect>
        </mask>

        <!-- Маска для верхнего отражения -->
        <mask id="mask--light-top">
            <rect fill="url(#gradient--bw-light)"
                width="100%" height="100%"
                transform="rotate(180, 100, 100)"></rect>
        </mask>

                <!-- Градиент блика -->
        <radialGradient id="gradient--spot" fy="20%">
            <stop offset="10%"
                  stop-color="white"
                  stop-opacity=".7"/>
            <stop offset="70%"
                  stop-color="white"
                  stop-opacity="0"/>
        </radialGradient>
    </defs>        

    <!-- Нижний блик -->
    <ellipse rx="40" ry="20" cx="150" cy="150"
       fill="url(#gradient--spot)"
       transform="rotate(-225, 150, 150)">
    </ellipse>    

    <!-- Нижнее отражение -->
    <circle r="50%" cx="50%" cy="50%"
        fill="aqua"
        mask="url(#mask--light-bottom)">
    </circle>

    <!-- Верхнее отражение -->
    <circle r="50%" cx="50%" cy="50%"
        fill="yellow"
        mask="url(#mask--light-top)">
    </circle>


    <!-- Верхний блик -->
    <ellipse rx="55" ry="25" cx="55" cy="55"
       fill="url(#gradient--spot)"
       transform="rotate(-45, 55, 55)">
    </ellipse>

    <!-- Фигура с маской и разноцветным градиентом -->
    <circle r="50%" cx="50%" cy="50%"
        fill="url(#gradient--colors)"
        mask="url(#mask--colors-transparency)">
    </circle>

</svg>


            
          
!
            
              BODY {
    background-color: #222;
    background-image: linear-gradient( to right,
        rgba(0,0,0,.2) 50%,
        rgba(0,0,0,0)  50%
    );
    background-size: 2em 2em;
    background-position: center center;
}

svg {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    padding: 2rem;
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console