6. Counter

counter

요구 사항
최소값은 0이다. 즉, 0과 양수만으로 카운트한다.
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Counter</title>
  <style>
    .container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 130px;
      margin: 20px auto;
      font-size: 24px;
      color: #3f51b5;
    }

    button {
      padding: 5px 10px;
      font-size: 24px;
      border-radius: 5px;
      color: #3f51b5;
      border-color: #3f51b5;
      outline: none;
      cursor: pointer;
    }

    .counter {
      width: 50px;
      text-align: center;
    }
  </style>
</head>
<body>
  <div class="container">
    <button class="increase">+</button>
    <div class="counter">0</div>
    <button class="decrease">-</button>
  </div>

  <script>

  </script>
</body>
</html>
Back to top