Newer
Older
hello-programmer-world / public / sample / php / quiz / exercise1 / quiz.html
@h.sakamoto h.sakamoto 21 hours ago 1 KB quiz
<!DOCTYPE html>
<html lang="ja">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>クイズ - 演習1</title>
  <style>
    body {
      font-family: sans-serif;
      max-width: 600px;
      margin: 50px auto;
      padding: 20px;
      background-color: #f5f5f5;
    }
    .quiz-container {
      background: white;
      padding: 30px;
      border-radius: 8px;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    h1 {
      color: #333;
      margin-bottom: 30px;
    }
    .question {
      margin-bottom: 20px;
      font-size: 18px;
      font-weight: bold;
    }
    .options {
      margin-bottom: 20px;
    }
    .option {
      margin: 10px 0;
    }
    button {
      background-color: #4CAF50;
      color: white;
      padding: 12px 30px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 16px;
    }
    button:hover {
      background-color: #45a049;
    }
  </style>
</head>
<body>
  <div class="quiz-container">
    <h1>クイズに挑戦!</h1>
    
    <form method="post" action="submit.php">
      <div class="question">
        問題: 日本の首都はどこでしょう?
      </div>
      
      <div class="options">
        <div class="option">
          <label>
            <input type="radio" name="answer" value="tokyo" required>
            東京
          </label>
        </div>
        <div class="option">
          <label>
            <input type="radio" name="answer" value="osaka">
            大阪
          </label>
        </div>
        <div class="option">
          <label>
            <input type="radio" name="answer" value="kyoto">
            京都
          </label>
        </div>
      </div>
      
      <button type="submit">答えを送信</button>
    </form>
  </div>
</body>
</html>