123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <h1>Static grid "tic-tac-toe-like".</h1>
<p>This grid is "static", uses a lot of classes to adapt the :before and :after pseudo elements depending on the position of each item.<br />
    Please visit this <a href="https://codepen.io/mcbenny/pen/EbEOvX" target="_top">automatic grid</a>, much better, that uses SCSS functions and variables.</p>
<div class="ttt" id="tic-tac-toe">
    <div class="ttt__box ttt__box--left">1</div>
    <div class="ttt__box">2</div>
    <div class="ttt__box ttt__box--right">3</div>
    <div class="ttt__box ttt__box--left">4</div>
    <div class="ttt__box">5</div>
    <div class="ttt__box ttt__box--right">6</div>
    <div class="ttt__box ttt__box--left ttt__box--bottom">7</div>
    <div class="ttt__box ttt__box--bottom">8</div>
    <div class="ttt__box ttt__box--bottom">9</div>
</div>
<!-- 
My "Proposition" for a tic-tac-toe-like grid...
https://alistapart.com/article/faux-grid-tracks
 -->
            
          
!
            
              .ttt {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    margin: 10vh auto;
    width: 80vh;
    height: 80vh;
    &__box {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        height: 100%;
        text-align: center;
        &:not(&--left)::before {
            display: block;
            position: absolute;
            left: 0;
            border-left: 1px solid #000;
            width: 0;
            height: 100%;
            content: '';
        }
        &:not(&--bottom)::after {
            display: block;
            position: absolute;
            bottom: 0;
            left: 0;
            border-bottom: 1px solid #000;
            width: 100%;
            height: 0;
            content: '';
        }
    }
}


/*
     General appearance, nothing related to what you see ;-)
*/
* {
     box-model: border-box;
}
body {
     line-height: 1.2em;
     font-family: "Segoe UI", sans-serif;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console