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

              
                <body class="min-h-screen " x-data="{ atTop: true, openModal: false }"
      x-on:scroll.window="atTop = (window.pageYOffset > 100) ? false : true; "
      x-on:keydown.escape=" openModal = openModal ? false : true">
<section class="fixed w-full p-6 z-10" x-bind:class="{ 'bg-white shadow-lg': !atTop }">
    <div class="flex items-center w-full justify-between">
        <div class="flex items-center">
            <div class="hover:scale-110 text-blue-700 "
                 x-bind:class="{ 'text-blue-900': !atTop, 'text-blue-700': atTop}">
                <svg class="h-8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
                     stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                    <path d="M3 3h18v18H3zM21 9H3M21 15H3M12 3v18"/>
                </svg>
            </div>
            <div class=" text-4xl ml-4 font-serif text-blue-700 "
                 x-bind:class="{ 'text-blue-900': !atTop, 'text-blue-700 scale-110': atTop}">SiteName
            </div>
        </div>
        <div class="flex items-center">
            <ul class="hidden md:flex flex items-center">
                <li class="p-2 text-gray-700 uppercase mr-8" x-data="{ open: false }"><a
                        href="#">Services</a></li>
                <li class="relative p-2 text-gray-700 uppercase mr-3" x-data="{ open: false }">
                    <button @click="open = true" style="text-transform: inherit" class="flex items-center">About
                        <svg class="h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
                             stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M6 9l6 6 6-6"/>
                        </svg>
                    </button>
                    <ul class="absolute mt-2 right-0 bg-whiteborder shadow-lg" x-show="open"
                        @click.away="open = false">
                        <li class="p-2 bg-gray-200 text-gray-700" x-data="{ open: false }"><a
                                href="#">Test</a></li>
                    </ul>
                </li>
                <li class="relative p-2 text-gray-700 uppercase mr-3" x-data="{ open: false }">
                    <button @click="open = true" style="text-transform: inherit" class="flex items-center">With Kids
                        <svg class="h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
                             stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M6 9l6 6 6-6"/>
                        </svg>
                    </button>
                    <ul class="absolute mt-2 right-0 bg-whiteborder shadow-lg" x-show="open"
                        @click.away="open = false">
                        <li class="p-2 bg-gray-200 text-gray-700" x-data="{ open: false }"><a
                                href="#">Child 1</a></li>
                        <li class="p-2 bg-gray-200 text-gray-700" x-data="{ open: false }"><a
                                href="#">Child 2</a></li>
                    </ul>
                </li>
            </ul>
            <div class="" x-on:click="openModal = !openModal">
                <svg class="h-8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
                     stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                    <line x1="3" y1="12" x2="21" y2="12"></line>
                    <line x1="3" y1="6" x2="21" y2="6"></line>
                    <line x1="3" y1="18" x2="21" y2="18"></line>
                </svg>
            </div>
        </div>
    </div>
</section>
<section class="fixed w-full p-6 h-full z-10 hidden bg-indigo-200"
         x-bind:class="{ 'hidden': !openModal }">
    <div class="flex items-center w-full justify-between">
        <div class="flex items-center">
            <div class="text-indigo-900 ">
                <svg class="h-8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
                     stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                    <path d="M3 3h18v18H3zM21 9H3M21 15H3M12 3v18"/>
                </svg>
            </div>
            <div class=" text-4xl ml-4 font-serif text-indigo-900 ">SiteName</div>
        </div>
        <div class="flex items-center">
            <div class="" x-on:click="openModal = !openModal">
                <svg class="h-8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
                     stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                    <line x1="18" y1="6" x2="6" y2="18"></line>
                    <line x1="6" y1="6" x2="18" y2="18"></line>
                </svg>
            </div>
        </div>
    </div>
</section>
<section class="py-64 bg-gray-300 ">
    <div class=" ">
        <div class="py-64 container mx-auto px-6">
            <div class=" "><h2 class=" text-5xl text-green-600 ">Heading</h2></div>
            <div class=" "></div>
        </div>
    </div>
</section>
<section class=" bg-no-repeat">
    <div class="bg-white">
        <div class="py-64 container mx-auto px-6">
            <div class=" "><h1 class=" p-0 m-0 text-4xl font-serif ">New Heading</h1></div>
        </div>
    </div>
</section>
<section class="bg-gray-900 ">
    <div class="px-6 py-64  ">
        <div class="mx-auto max-w-3xl font-light text-indigo-100 text-2xl mb-4 font-serif "><p>"Lorem ipsum dolor sit
            amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore etdolore magna aliqua. Ut enim
            ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquipex ea commodo consequat. Duis aute
            irure dolor in reprehenderit in voluptate velit esse cillum dolore eufugiat nulla pariatur. Excepteur sint
            occaecat cupidatat non proident, sunt in culpa qui officiadeserunt mollit anim id est laborum."</p></div>
        <label class=" max-w-2xl mx-auto block text-green-200 font-bold ">source here</label></div>
</section>
<section class="px-6 py-16 overflow-x-hidden bg-gray-400">
    <div class="container mx-auto p-6 mb-6"><h2 class=" font-serif text-3xl text-center "
    >Lorem ipsum dolor sit amet</h2>
        <div class="text-center " data-aos="flip-down"><p>Ut enim ad minim veniam, quis nostrud
            exercitation ullamco laboris nisi ut aliquip ex ea commodoconsequat.</p></div>
    </div>
    <div class="container flex flex-wrap w-full mx-auto px-2">
        <div class="w-full lg:w-1/3 mb-6 ">
            <div class="mx-2 h-full p-4 bg-indigo-200 shadow-lg">
                <div class="text-indigo-300 ">
                    <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none"
                         stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"></path>
                        <line x1="4" y1="22" x2="4" y2="15"></line>
                    </svg>
                </div>
                <h3 class=" text-2xl text-blue-800 font-bold ">Lorem ipsum dolor sit amet</h3>
                <div class="font-thin "><p>Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
                    dolore magna aliqua.Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
                    dolore magnaaliqua.</p></div>
            </div>
        </div>
        <div class="w-full lg:w-1/3 mb-6 ">
            <div class="h-full mx-2 p-4 bg-indigo-200 shadow-lg">
                <div class="text-indigo-300 ">
                    <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none"
                         stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"></path>
                        <line x1="4" y1="22" x2="4" y2="15"></line>
                    </svg>
                </div>
                <h3 class=" text-2xl text-blue-800 font-bold ">Lorem ipsum dolor sit amet</h3>
                <div class="font-thin "><p>Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
                    dolore magnaaliqua.</p></div>
            </div>
        </div>
        <div class="w-full lg:w-1/3 mb-6 ">
            <div class="mx-2 h-full p-4 bg-indigo-200 shadow-lg">
                <div class="text-indigo-300 ">
                    <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none"
                         stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"></path>
                        <line x1="4" y1="22" x2="4" y2="15"></line>
                    </svg>
                </div>
                <h3 class=" text-2xl text-blue-800 font-bold ">Lorem ipsum dolor sit amet</h3>
                <div class="font-thin "><p>Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
                    dolore magnaaliqua.</p></div>
            </div>
        </div>
    </div>
</section>
<section class="py-32 px-6 text-white overflow-x-hidden bg-gray-600">
    <div class="container max-w-3xl mx-auto">
        <div class="text-green-100 mb-2 ">
            <svg class="mx-auto" xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24"
                 fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
                <path d="M22 17H2a3 3 0 0 0 3-3V9a7 7 0 0 1 14 0v5a3 3 0 0 0 3 3zm-8.27 4a2 2 0 0 1-3.46 0"></path>
            </svg>
        </div>
        <h2 class=" font-serif text-3xl text-center leading-tight mb-4 "
        >Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
            incididunt ut labore etdolore magna aliqua.</h2>
        <div class="text-center font-light text-lg mb-4 " data-aos="flip-right"
        ><p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
            aliquip ex ea commodoconsequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
            eu fugiat nullapariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
            mollit animid est laborum.</p></div>
        <ul class="flex flex-wrap justify-center" data-aos="fade-down"
        >
            <li class="uppercase m-4 p-4 rounded-full hover:bg-white hover:text-blue-600 font-bold border-2"
                x-data="{ open: false }"><a href="#">Duis aute irure dolor</a></li>
            <li class="uppercase m-4 p-4 rounded-full hover:bg-white hover:text-blue-600 font-bold border-2"
                x-data="{ open: false }"><a href="#">Excepteur</a></li>
        </ul>
    </div>
</section>
</body>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console