I dont understand why it isnt working

i cant get my code to work, i am trying to make 16 squares in bootstrap but the only thing that appears are there borders. Please help

<!DOCTYPE html>
<html>
<head>
  <link rel="icon" href="favicon.png" type="image/x-icon">
  <link rel="stylesheet" href="resources/css/reset.css">
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
  <link rel="stylesheet" href="resources/css/style.css">
  <title>Match Game</title>
</head>
<body>
  <div class="container">
    <div class="row">
      <div class="gameInstructions col-sm-12 col-md-3">
        <h1>Match Game</h1>
        <h2>Rules</h2>
        <p>Click on a card to reveal the number on the other side. Click on a second card to try and find a match to the first. If you succeed, the pair will be removed from play. If not, try again!</p>
        <h2>How To Win</h2>
        <p>You win when all pairs have been found.</p>
      </div>
      <div id="game"class="col-sm-12 col-md-9">
        <div class="row">
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
          <div class="col-xs-3 card"></div>
        </div>
      </div>
    </div>
  </div>
  <script
    src="https://code.jquery.com/jquery-3.1.1.min.js"
    integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
    crossorigin="anonymous"></script>
  <script type="text/javascript" src="./resources/js/match-game.js"></script>
  <script type="text/javascript" src="./resources/js/tests.js"></script>
</body>
</html>

/*Universal Styling*/
html{
  font-size: 14px;
}

body{
  font-family: "Work Sans", sans-serif;
  background-color: rgb(255,242,242);
  padding-top: 5.25rem;
}

p{
  color: rgb(74, 74, 74);
}

h1{
  font-weight: bold;
  font-size: 2.5rem;
  color: rgb(32, 64, 86);
}

h2{
  font-weight: bold;
  font-size: 1rem;
}

/*Specified Styling*/
.card{
  height: 12.5rem;
  background-color: rgb(153, 153, 153);
  border: 4px solid #fff;
  border-radius: 8px;
}

You didn’t give them a width ;). Add width: 12.5rem; to your .card class.

but that shouldnt be necessary if it already has a class of col-xs-3, of course i can do that but it shouldnt be necessary with bootsrap

Seems to me your Bootstrap is not working then.

could you give me an alternative bootstrap link please

The -xs- infix is no longer used in Bootstrap 4

1 Like

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.