html - Bootstrap Squared Columns for Tic-Tac-Toe Board? -


i building tic-tac-toe interface, using html, css, , bootstrap. i'm trying board squared (1:1) i'm getting nowhere.

the boxes have taller use more space. can playing height property using vw/vh units on columns, won't keep 1:1 ratio across resolutions.

tic tac toe

this other version has "pads" on each side of board , job breaks on sizes smaller tablets. apart lose space.

tic tac toe pads


now, here's code tic tac toe without pads:

<!doctype html> <html lang="en">  <head>   <meta charset="utf-8">   <title>tic tac toe</title>   <meta name="viewport" content="width=device-width, initial-scale=1.0">    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/y6pd6fv/vv2hjna6t+vslu6fwyxjcftcephbnj0lyafsxtsjbbfadjzaleqsn6m" crossorigin="anonymous">   <link rel="stylesheet" href="css/styles.css">   <script src="js/script.js"></script> </head>  <body>   <div class="container-fluid">     <div class="row">       <div class="col-12 col-sm-2 ads"> "ads </div>       <div class="col-12 col-sm-6 content">         <div class="container-fluid tic-container">           <div class="row tic-row">             <div class="col-4 tic-box"> 1 </div>             <div class="col-4 tic-box"> 2 </div>             <div class="col-4 tic-box"> 3 </div>           </div>           <div class="row tic-row">             <div class="col-4 tic-box"> 4 </div>             <div class="col-4 tic-box"> 5 </div>             <div class="col-4 tic-box"> 6 </div>           </div>           <div class="row tic-row">             <div class="col-4 tic-box"> 7 </div>             <div class="col-4 tic-box"> 8 </div>             <div class="col-4 tic-box"> 9 </div>           </div>         </div>       </div>       <div class="col-12 col-sm-2 tic-panel"> panel-thingy<br>score:<br>foo bar: stuff<br> reset game , blah </div>          <div class="col-12 col-sm-2 ads"> ads </div>     </div>   </div> </body>  </html> 

.ads{   text-align: center;   margin: .4vw 0;   background: #f4cc70;   padding: .4vw; }  .content{   margin: .4vw 0;   background: lightblue;   padding: .4vw; } .tic-panel{   border: solid 2px black;   margin: .4vw 0;   background: #66a5ad;   padding: .4vw; }  .tic-box{   border: solid black 1px;   font-size: 5vw;   background: #6ab187;   text-align: center;   color: lavender; } .tic-box:hover{   background: #20948b; } 

anyways, appreciate pointers i'm doing wrong or should do. guess i'm doing wrong, not taking full advantage of bootstrap.

also, love if tell me if doing against principles of bootstrap, such using rows or col shouldn't.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -