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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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.

HTML

              
                <html lang="en">
<head>
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta charset="utf-8">
   <title>Tic Tac Toe board layout</title>
   <meta name="author" content="Designed and coded by the doer.">
   <meta name="description" content="The project created during Free Code Camp course according to Tic Tac Toe specification">
</head>
<body>
 
   <div id="symbol-choice" class="modal fade" tabindex="-1" role="dialog">
     <div class="modal-dialog">
       <div class="modal-content">
         <div class="modal-header">
           <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
           <h4 class="modal-title">Tic Tac Toe</h4>
           
         </div>
         <div class="modal-body">
           <p>Choose the sign you want to play with</p>
         </div>
         
        <button id="o" type="button" class="btn btn-default" data-dismiss="modal">O</button>
         <span> or </span>
        <button id="x" type="button" class="btn btn-default" data-dismiss="modal">X</button>
         
       </div><!-- /.modal-content -->
     </div><!-- /.modal-dialog -->
   </div><!-- /.modal -->
  
   <!-- board-->
   <section class="game-board">
      <div class="game-name">
         <h1>
            Tic Tac Toe board layout
         </h1>
      </div>
      <div class="board-area">
         <div id="one-left" class="board-box border-right"><span>1</span></div>
         <div id="one-middle" class="board-box border-right"><span>2</span></div>
         <div id="one-right" class="board-box"><span>3</span></div>
         <div id="two-left" class="board-box border-right border-top"><span>4</span></div>
         <div id="two-middle" class="board-box border-right border-top"><span>5</span></div>
         <div id="two-right" class="board-box border-top"><span>6</span></div>
         <div id="three-left" class="board-box border-right border-top"><span>7</span></div>
         <div id="three-middle" class="board-box border-right border-top"><span>8</span></div>
         <div id="three-right" class="board-box border-top"><span>9</span></div>
      </div>
      
    <!-- setings buttons-->
      <div class="settings">
         <div id="score" class="settings-button border-wide">
            <h2>score</h2>
         </div>
         <div id="symbol" class="settings-button border-wide border-settings-top">
            <h2>symbol</h2>
         </div>
         <div id="mode" class="settings-button border-settings-top">
            <h2>mode</h2>
         </div>
      </div>
   </section> <!-- board -->
   
</body>  
</html>   
              
            
!

CSS

              
                body {
   color: #fff;
}
.game-board {
   height: 100vh;
}
.game-name {
   height: 10%;
   background-color: #03a9f4;
   color: #fff;
   padding: 1em;
   text-align: center;
}
.board-area {
   height: 75%;
   background-color: #b3e5fc;
   position: relative;
   text-align: center;
}
.settings {
   height: 15%;
   background-color: #607d8b;
}
h1 {
   margin: 0;
}
.board-box {
   position: absolute;
   width: 33.33%;
   height: 33.33%;
   display: table;
}
.board-box span {
   display: table-cell;
   vertical-align: middle;
   font-size: 5em;
}
#one-left {
   top: 0;
   left: 0;
}
#one-middle {
   top: 0;
   left: 33.33%;
}
#one-right {
   top: 0;
   left: 66.66%;
}
#two-left {
   top: 33.33%;
   left: 0;
}
#two-middle {
   top: 33.33%;
   left: 33.33%;
}
#two-right {
   top: 33.33%;;
   left: 66.66%;
}
#three-left {
   top: 66.66%;
   left: 0;
}
#three-middle {
   top: 66.66%;
   left: 33.33%;
}
#three-right {
   top: 66.66%;
   left: 66.66%;
}
.settings {
   position: relative;
}
.settings-button {
   position: absolute;
   width: 33.33%;
   height: 100%;
   text-align: center;
   border-radius: 20px 0;
   text-transform: uppercase;
}
#score {
   top: 0;
   left: 0;
}
#symbol {
   top: 0;
   left: 33.33%;
}
#mode {
   top: 0;
   left: 66.66%;
}
.border-right {
   border-right: 3px solid white;
}
.border-top {
   border-top: 3px solid white;
}
.border-wide {
   border-right: 3px solid black;
}
h2 {
      font-size: 1.2em;
   }

/* media queries */
@media screen and (min-width: 1025px){
   .board-area {
       height: 90%;
       width: 60%;
   }
   .settings {
       position: absolute;
       top: 10%;
       right: 0;
       left: 60%;
       bottom: 0;
       height: auto;
   }
   #score {
      right: 0;
      width: 100%;
      height: 33.33%;
   }
   #symbol {
      right: 0;
      width: 100%;
      height: 33.33%;
      top: 33.33%;
      left: 0;
   }
   #mode {
      right: 0;
      width: 100%;
      height: 33.33%;
      left: 0;
      top: 66.66%;
   }
   .border-wide {
      border-right: 0;
   }
   .border-settings-top {
      border-top: 3px solid black;
   }
   .settings-button {
      border-radius: 0 20px;
   }
}
@media screen and (max-width: 767px) and (orientation: landscape)  {
   .game-name {
      padding:0;
      font-size: 1.8em;
   }
}
@media screen and (min-width: 768px) {
   h2 {
      font-size: 1.5em;
   }
}
.modal-dialog {
   color: #000;
}
.modal-content {
   background-color: pink;
   text-align: center;
   font-size: 1.2em;
}
.modal-header h4 {
   font-size: 2em;
   color: #fff;
}
#symbol-choice .btn {
   padding: 0.5em 1em;
   font-size: 1.5em;
   margin-bottom:1.5em;
}

              
            
!

JS

              
                // the project moved to Github, live preview: http://theonewhodo.es/tictactoe/ 

              
            
!
999px

Console