Home
Tutorial
Quiz App
Build Quiz App using HTML, CSS and JavaScript
Online HTML Editor : Quiz App Question Display
Run Output
Output Rosolution:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Quiz</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;400;700&display=swap" rel="stylesheet"> <style> *{ margin: 0; padding: 0; box-sizing: border-box; } body{ background: #911ae2; font-family: 'Roboto', sans-serif; } .inactive{ display: none; } .disabled{ pointer-events: none; } .quiz-box{ position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #fff; border: 2px solid #fff; box-shadow: 0 0 10px #777; padding: 50px; width: 100%; max-width: 600px; background: rgba(0,0,0,0.5); } .quiz-box h2{ font-size: 30px; } .quiz-box .option{ font-size: 18px; border: 2px solid #fff; margin: 20px 0; padding: 12px 15px; border-radius: 5px; transition: all 0.3s; cursor: pointer; position: relative; } .quiz-box .option .fa{ position: absolute; top: 6px; right: 10px; font-size: 30px; } .quiz-box .option.incorrect{ background: rgb(241, 153, 153); color: rgb(184, 12, 12); border-color: rgb(184, 12, 12); } .quiz-box .option.correct{ background: rgb(157, 246, 157); color: rgb(6, 138, 28); border-color: rgb(6, 138, 28); } .quiz-box .option:hover{ background: #911ae2; } .quiz-footer{ margin-top: 50px; padding-top: 30px; border-top: 2px dashed #fff; display: flex; justify-content: space-between; align-items: center; height: 100px; } .count_que,.total_que{ font-weight: bolder; font-size: 20px; } .footer-left{ font-size: 18px; } .next-btn{ font-size: 18px; border: 2px solid #fff; border-radius: 5px; padding: 10px; cursor: pointer; transition: all 0.3s; } .next-btn:hover{ background: #fff; color: #911ae2; } </style> </head> <body> <div class="quiz-box"> <h2 class="que_text">1. Hyper Text Markup Language</h2> <div class="options"> <div class="option incorrect disabled">Hyper Text Multiple Language<i class="fa fa-times"></i></div> <div class="option disabled">Hyper Text Preprocessor</div> <div class="option disabled">Hyper Tool Multi Language</div> <div class="option correct disabled">Hyper Text Markup Language<i class="fa fa-check"></i></div> </div> <div class="quiz-footer"> <div class="footer-left"> <span class="count_que">1</span> of <span class="total_que">5</span> Questions </div> <div class="footer-right"> <div class="next-btn">Next Question</div> </div> </div> </div> </body> </html>