js+css实现小学数学出提器(可打印)代码
代码语言:html
所属分类:其他
代码描述:js+css实现小学数学出提器(可打印)代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> body { font-family: Arial, sans-serif; background-color: #f0f0f0; margin: 0; padding: 0; } .header { background-color: #4CAF50; color: white; text-align: center; padding: 1em; } .container { max-width: 800px; margin: 20px auto; background-color: #fff; padding: 20px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } .hidden { display: block; } #options { margin-bottom: 20px; line-height: 28px; } input { max-width: 50px; } .print-r { text-align: center; font-size: 18px; padding: 20px; } label { margin-right: 10px; } #questions { display: grid; grid-template-columns: repeat(2, 1fr); grid-gap: 10px; } .question { border: 1px solid #ccc; padding: 10px; margin-bottom: 10px; color: #000; } button.btn { padding: 5px; background-color: #4caf50; color: #fff; border: none; border-radius: 5px; cursor: pointer; transition: background-color 0.3s ease; } </style> </head> <body> <div class="header"> <h1>小学数学出题器</h1> <h3>说明:生成题目后,点击显示/隐藏选项,即可打印纯净试卷。</h3> </div> <p style="text-align:center;margin-top:10px"> <button class="btn" onclick="toggleOptions()">显示/隐藏选项</button> <button class="btn" onclick="printQuestions()">一键打印题目</button> </p> <div class="container"> <div class="print-r"> 姓名:_________ 日期:____月____日 时间:________ 对题:____道<br><br> </div> <div id="options" class="hidden"> <label>运算符:</label> <input type="checkbox" id="addition" checked> 加法 <input type="checkbox" id="subtraction" checked> 减法 <input type="checkbox" id="multiplication" checked> 乘法 <input type="checkbox" id="division" checked> 除法 <br> <label>数字个数:</label> <input type="number" id="numDigits" value="2"> <br> <label>允许小数:</label> <input type="checkbox" id="allowDecimal"> 是 <br> <label>题目数量:</label> <input type="number" id="numQuestions" value="10"> <br> <label>数字范围:</label> <input type="number" id="minRange" value="1"> <span>-</span> <input type="number" id="maxRange" value="100"> <br> <label>文字颜色:</label> <input type="color" id="textColor" value="#000000"> <br> <button class="btn" onclick="generateQuestions()">生成题目</button> </div> <div id="questions" class="hidden"></div> </div> <script> function toggleOptions() { var content .........完整代码请登录后点击上方下载按钮下载查看
网友评论0