Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <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>


              
            
!

CSS

              
                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;
}
              
            
!

JS

              
                
              
            
!
999px

Console