Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

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

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

Behavior

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.

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.

Template

Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Screenshot

Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML

              
                <!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>Document</title>
    </script>
    <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
</head>

<body>

    <div class="bg-gray-600 h-full flex flex-col md:grid md:grid-cols-8 w-screen h-screen">
  <!-- 3 columns to the left and 5 at the right hand side -->
        <div class="md:col-span-3 p-4 text-white flex items-center justify-center flex-col">
                <!-- gray rectangle with an organized list -->
            <ol class="list-decimal pl-6">
              <!-- the organized list and each item -->
                <li class="md:mb-20 mb-0 font-mono">We can change the look of our logo by being explicit in the CSS Media Queries.</li>
                <li class="md:mb-20 mb-0 font-mono">We can show as much or as little as we want, it's up to us.</li>
                <li class="md:mb-20 mb-0 font-mono">It's all done by using SVG, CSS elements, media queries and nothing else.</li>
            </ol>
          <!-- the list is closed -->
        </div>
      <!-- that gray rectangle is closed -->
        <div class="h-full bg-white md:col-span-5 p-4 flex items-center justify-center text-white">
<!-- the part where the svg is shown -->
            <div class="mt-10 md:mt-0 container mx-auto lg:border-4 lg:border-purple-500 lg:bg-white md:border-4 md:border-yellow-500 md:bg-gray-900 sm:border-4 sm:border-red-500 border-4 border-green-500 rounded-md"> <!-- an inner wrapper for our main actor -->
              <!-- svg elements and goodies -->

<!-- responsive design classes and media queries should start after the automated classes such as .st3, .st4, and .st6 -->
                <svg 
                    xmlns="http://www.w3.org/2000/svg" 
                    viewBox="0 0 330 377"
                    class="mx-auto pt-4"
                >
                    <style>
                        .st3{fill:#333}
                        .st4{fill:#040006}
                        .st6{fill:#fff}

                        svg * {
                            transition: fill .1s ease-out, opacity .1s ease-out;
                        }
                        
                        @media all and (min-width: 320px) {
                            svg {
                                width: 144px;
                            }
                            #orange-circle {
                                opacity: 0;
                            }
                            #whistle-inner {
                                opacity: 1;
                            }
                            .st3 {
                                fill: #040006;
                            }
                        }

                        @media all and (min-width: 640px) {
                            svg {
                                width: 144px;
                            }
                            .st3 {
                                fill: #fff;
                            }
                            .st6 {
                                fill: #000000;
                            }
                        }

                        @media all and (min-width: 768px) {
                            svg {
                                width: 89px;
                            }
                            #purple-circle {
                                opacity: 0;
                            }
                            .st6 {
                                fill: #fff;
                            }
                            .st4 {
                                fill: gainsboro;
                            }
                        } <!-- md -->

                        @media all and (min-width: 1024px) {
                            svg {
                                width: 377px;
                            }
                            #orange-circle, #purple-circle {
                                opacity: 1;
                            }
                            .st6 {
                                fill: #fff;
                            }
                            .st3 {
                                fill: #333;
                            }
                            .st4 {
                                fill: #040006;
                            }
                        } <!-- lg -->

                    </style>

                        <!-- purple -->
                        <circle cx="161.7" cy="140.2" r="140.2" fill="#63c" id="purple-circle"/>
                        <!-- orange -->
                        <circle cx="147.8" cy="150.7" r="114.7" fill="#f93" id="orange-circle"/>

                        <g opacity=".55" id="whistle-inner">
                            <path 
                                class="st3" 
                                d="M61.6 167.4c.6 9.4-6.8 17.1-16 17.1v-32.1h1c8 .5 14.5 7 15 15z"
                            /> <!-- whistle inner dot  -->
                            <path 
                                class="st3" 
                                d="M45.5 198.3c17.1 0 30.9-14.4 29.8-31.8-.9-14.9-13-27-27.9-27.9h-1.9v-12.5c27.2 0 51.8 14.9 69.9 39 1.5 2 1.5 4.7 0 6.7-18.2 24.2-42.8 39-69.9 39v-12.5z"
                            /> <!-- whistle smooth curve -->
                        </g> <!-- eye -->

                        <g id="isotype">
                            <path 
                                class="st4" 
                                d="M35.8 239.2l-4.2 19 18.1-7.2 8.9 7.6-26.9 31.6-8.9-7.6L33.5 270l-18.1 7.2 4.2-19-10.7 12.6-8.9-7.6 26.9-31.6 8.9 7.6zM69.9 263.6l-5.8 45.2-11.2-6.4.7-4.4-5.2-3-3.4 2.9-11.2-6.4 36.1-27.9zm-13.7 26.5l.9-4.3-3.2 3 2.3 1.3zM81 308.9c-.7 1.7-1.6 3.2-2.8 4.5-1.1 1.3-2.4 2.3-3.8 2.9l-10.5-4.4c1.4-.6 2.7-1.6 3.8-2.9s2.1-2.8 2.8-4.5l13.8-32.9 10.5 4.4L81 308.9zM93.9 319.6l-11.1-3.7L96 276.5l11.1 3.7-13.2 39.4zM138.7 287.2l-12.5 15.5 3.9 25.1-12.3-2.5-1.6-10.2-6.8 8.5-10.2-2.1 8.3-40.7 11.4 2.3-2.7 13.3 9.6-11.8 12.9 2.6zM173.2 287.2l12.9-.3-10 42.3-12-13-11.3 13.7-12.3-41.7 12.9-.4 4.7 18.6 5.5-8.3 6 8 3.6-18.9z"
                            /> <!-- "MAJIK W" -->
                            <path 
                                class="st4" 
                                d="M205.2 324l-3.1-14.6-3.1.7 3.1 14.6-11.4 2.4-8.5-40.6 11.4-2.4 3.1 14.6 3.1-.7-3.1-14.6 11.4-2.4 8.5 40.6-11.4 2.4zM232.8 316.2l-11.1 3.7-13-39.4 11.2-3.7 12.9 39.4zM255.7 291c1.7 3.7 1.9 7.4.7 11.1-1.2 3.7-3.8 6.4-7.7 8.2-3 1.3-6 1.7-9.1 1.2s-5.7-1.8-7.8-4l7.9-8.8c1.3 1.1 2.6 1.4 3.8.9.7-.3 1.2-.9 1.4-1.6.2-.7.2-1.5-.1-2.2-.3-.6-.8-1-1.5-1.3s-1.8-.2-3.2 0c-3 .6-5.9.3-8.7-.7-2.8-1-4.9-3.1-6.3-6.2s-1.6-6.3-.4-9.4c1.1-3.1 3.2-5.4 6.3-6.8 1.6-.7 3.2-1.1 4.8-1.1 1.6 0 2.8.1 3.7.5l-2.7 12.1c5-1.1 9.1-.8 12.2 1 3.1 1.7 5.4 4.1 6.7 7.1z"
                            /> <!-- "HIS" -->
                            <path 
                                class="st4" 
                                d="M265.9 301l-15.3-25.6-6.9 4.1-6-10.1 23.8-14.2 6 10.1-6.9 4.1 15.3 25.6-10 6z"
                            /> <!-- "T" -->
                            <path 
                                class="st4" 
                                d="M288.4 271.6l8-6.3 7.3 9.2-17.1 13.5-25.8-32.6 9.2-7.2 18.4 23.4zM294 242.3l2.2 2.2 7.7-7.8 8.3 8.2-7.7 7.8 2.3 2.2 7.7-7.8 8.4 8.2-15.9 16.1-29.7-29 15.9-16.1 8.4 8.2-7.6 7.8z"
                            /> <!-- "LE" -->
                        </g> <!-- "MAJIK WHISTLE" -->

                        <g id="whistle"> 
                            <path 
                                d="M269.5 170.1l-42.2-21.2c-1.9-.9-4-1.1-6-.5l-18 6-18.2-9.2 3.5-7c2-3.9.4-8.6-3.5-10.6l-63.3-31.9c-38.8-19.5-86.2-3.8-105.7 35s-3.8 86.2 35 105.7c34.8 17.5 76.6 7.1 99.2-24.1l97.5 7.8c3.2.3 6.2-1.5 7.7-4.3l17.7-35.2c1.7-3.8.1-8.5-3.7-10.5zM68.6 201.3c-19.4-9.8-27.3-33.4-17.5-52.9 9.8-19.4 33.4-27.3 52.9-17.5 19.4 9.8 27.3 33.4 17.5 52.9S88 211.1 68.6 201.3z" 
                                fill="#0c6"
                            /> <!-- whistle -->
                        </g>
                    
                        <g id="white-stripes">
                            <g> 
                                <path 
                                    class="st6" 
                                    d="M241.5 67.9c-3.9-2-8.6-.4-10.6 3.5l-21.2 42.2c-2 3.9-.4 8.6 3.5 10.6s8.6.4 10.6-3.5L245 78.5c2-3.9.4-8.6-3.5-10.6z"
                                /> <!-- 1 -->
                            </g> 

                            <g>
                                <path 
                                    class="st6" 
                                    d="M196.4 101.6l-7-38.8c-.8-4.3-4.9-7.1-9.1-6.4-4.3.8-7.1 4.9-6.4 9.1l7 38.8c.5 2.5 2.1 4.6 4.2 5.6 1.5.7 3.2 1 4.9.7 4.3-.6 7.1-4.7 6.4-9z"
                                /> <!-- 2 -->
                            </g> 
                            
                            <g>
                                <path
                                    class="st6" 
                                    d="M287.2 110.3c-1.9-3.9-6.6-5.5-10.6-3.5l-35.2 17.5c-3.9 1.9-5.5 6.7-3.5 10.6.8 1.6 2.1 2.8 3.5 3.5 2.1 1.1 4.7 1.2 7 0l35.3-17.5c3.8-2 5.4-6.7 3.5-10.6z"
                                /> <!-- 3 -->
                            </g>
                        </g> <!-- the white stripes -->

                </svg>
            </div>
        </div>
    </div>

</body>
</html>

<!-- 
hope you find this useful. however, I can't credit myself with this powerful knowledge, here goes some more SVG info and even more useful resources, cheers.

https://tympanus.net/Tutorials/ResponsiveSVGs/index6.html

https://slides.com/sarasoueidan/
 -->


              
            
!

CSS

              
                img:not(.png) {
  width: 100%;
}


              
            
!

JS

              
                
              
            
!
999px
Two CSS properties walk into a bar. A barstool in a completely different bar falls over.

Console