以下为测试的部分代码:
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>物料管理系统</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/layui/css/layui.css"> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap" rel="stylesheet"> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Poppins', sans-serif; background-color: #f0f4f8; /* 更柔和的背景色 */ color: #333; } /* 左侧导航样式 */ #leftNav { position: fixed; top: 0; left: 0; width: 250px; height: 100%; background-color: #2C3E50; /* 深蓝色 */ color: #fff; padding-top: 20px; box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1); } /* 左侧导航栏标题 */ #leftNav .title { color: #fff; font-size: 24px; font-weight: bold; text-align: center; margin-bottom: 20px; padding: 10px 0; background-color: #1A242F; /* 深蓝色背景 */ } #leftNav .layui-nav { margin-top: 20px; } #leftNav .layui-nav-item { background-color: #2C3E50; border-bottom: 1px solid #34495E; } #leftNav .layui-nav-item a { color: #fff; font-size: 18px; padding: 12px 20px; text-decoration: none; display: block; } #leftNav .layui-nav-item a:hover { background-color: #34495E; } #leftNav .layui-nav-child dd a { padding-left: 40px; background-color: #34495E; } #leftNav .layui-nav-child dd a:hover { background-color: #5D6D7E; } /* 主内容区域 */ .main-content { margin-left: 250px; padding: 30px; transition: margin-left 0.3s ease; background-color: #fff; /* 白色背景 */ min-height: 100vh; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1); /* 给主区域加个阴影,提升视觉效果 */ } .main-content header { background-color: #3498DB; /* 蓝色 */ color: white; padding: 20px; font-size: 30px; text-align: center; border-radius: 8px; margin-bottom: 20px; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); } .main-content h2 { color: #2C3E50; font-size: 24px; margin-bottom: 20px; font-weight: 500; } .main-content p { color: #7F8C8D; font-size: 18px; } .layui-row { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; } .layui-col-xs6 { flex: 1 1 calc(33% - 20px); min-width: 300px; max-width: 350px; } .layui-card { border-radius: 8px; overflow: hidden; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); background-color: #ecf0f1; /* 柔和的背景色 */ } .layui-card-header { background-color: #2980B9; /* 深蓝色 */ color: white; font-size: 20px; font-weight: 600; padding: 15px; } .layui-card-body { padding: 20px; color: #34495E; } footer { background-color: #34495E; /* 深灰蓝色 */ color: white; text-align: center; padding: 20px; margin-top: 50px; font-size: 14px; } footer a { color: #ecf0f1; text-decoration: none; font-weight: 500; } footer a:hover { color: #fff; } @media (max-width: 768px) { .main-content { margin-left: 0; padding: 20px; } #leftNav { width: 100%; position: relative; } #leftNav .layui-nav-item a { padding-left: 20px; } } </style> </head> <body> <!-- 左侧导航栏 --> <div id="leftNav"> <div class="title"> 物料管理系统 </div> <div class="layui-nav layui-nav-tree"> <div class="layui-nav-item"> <a href="javascript:;">物料管理</a> <dl class="layui-nav-child"> <dd><a href="javascript:void(0);" onclick="loadPage('issue_material.html')">发料申请</a></dd> <dd><a href="javascript:void(0);" onclick="loadPage('return_material.html')">退料申请</a></dd> <dd><a href="javascript:void(0);" onclick="loadPage('supply_material.html')">补料申请</a></dd> <dd><a href="javascript:void(0);" onclick="loadPage('product_inbound.html')">产品入库</a></dd> <dd><a href="javascript:void(0);" onclick="loadPage('stock_management.html')">库存管理</a></dd> </dl> </div> </div> </div> <!-- 主内容区域 --> <div class="main-content"> <div id="contentArea"> <h2>欢迎来到物料管理系统</h2> <p>请选择左侧菜单中的操作来管理物料。</p> </div> <footer> <p>© 2024 物料管理系统. <a href="#">隐私政策</a> | <a href="#">联系我们</a></p> </footer> </div> <script src="https://cdn.jsdelivr.net/npm/layui/layui.js"></script> <script> layui.use(['element'], function () { var element = layui.element; }); // 动态加载页面内容 function loadPage(url) { var contentArea = document.getElementById('contentArea'); contentArea.innerHTML = "<h2>加载中...</h2>"; var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.onload = function() { if (xhr.status === 200) { contentArea.innerHTML = xhr.responseText; } else { contentArea.innerHTML = "<h2>无法加载页面</h2>"; } }; xhr.onerror = function() { contentArea.innerHTML = "<h2>加载错误</h2>"; }; xhr.send(); } </script> </body> </html>
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>发料申请</title> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet"> <style> body { font-family: 'Roboto', sans-serif; background-color: #f7f7f7; margin: 0; padding: 0; } header { background-color: #2a87f0; color: white; padding: 20px; text-align: center; font-size: 30px; } nav { background-color: #333; padding: 12px 0; text-align: center; } nav a { color: white; margin: 0 20px; text-decoration: none; font-size: 16px; } nav a:hover { background-color: #575757; padding: 10px 20px; border-radius: 5px; } .container { width: 60%; max-width: 800px; margin: 40px auto; padding: 20px; background-color: #fff; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } h2 { text-align: center; font-size: 28px; margin-bottom: 20px; } .form-group { margin-bottom: 20px; } label { font-size: 16px; display: block; margin-bottom: 5px; } input[type="text"], input[type="number"], textarea { width: 100%; padding: 12px; border-radius: 5px; border: 1px solid #ddd; font-size: 16px; } button { width: 100%; padding: 14px; background-color: #2a87f0; border: none; border-radius: 5px; color: white; font-size: 18px; cursor: pointer; margin-top: 20px; } button:hover { background-color: #1a6fc5; } </style> </head> <body> <header> 发料申请 </header> <nav> <a href="index.html">首页</a> <a href="issue_material.html">发料</a> <a href="return_material.html">退料</a> <a href="stock_management.html">库存管理</a> <a href="supply_material.html">补料申请</a> </nav> <div class="container"> <h2>请输入发放的物料信息</h2> <form action="submit_issue_request.html" method="POST"> <div class="form-group"> <label for="materialId">物料ID:</label> <input type="text" id="materialId" name="materialId" required> </div> <div class="form-group"> <label for="quantity">发放数量:</label> <input type="number" id="quantity" name="quantity" required> </div> <div class="form-group"> <label for="reason">发放原因:</label> <textarea id="reason" name="reason" required></textarea> </div> <button type="submit">提交发料申请</button> </form> </div> </body> </html>
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>产品入库</title> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet"> <style> body { font-family: 'Roboto', sans-serif; background-color: #f7f7f7; margin: 0; padding: 0; } header { background-color: #2a87f0; color: white; padding: 20px; text-align: center; font-size: 30px; } nav { background-color: #333; padding: 12px 0; text-align: center; } nav a { color: white; margin: 0 20px; text-decoration: none; font-size: 16px; } nav a:hover { background-color: #575757; padding: 10px 20px; border-radius: 5px; } .container { width: 60%; max-width: 800px; margin: 40px auto; padding: 20px; background-color: #fff; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } h2 { text-align: center; font-size: 28px; margin-bottom: 20px; } .form-group { margin-bottom: 20px; } label { font-size: 16px; display: block; margin-bottom: 5px; } input[type="text"], input[type="number"], input[type="date"], textarea { width: 100%; padding: 12px; border-radius: 5px; border: 1px solid #ddd; font-size: 16px; } button { width: 100%; padding: 14px; background-color: #2a87f0; border: none; border-radius: 5px; color: white; font-size: 18px; cursor: pointer; margin-top: 20px; } button:hover { background-color: #1a6fc5; } </style> </head> <body> <header> 产品入库 </header> <nav> <a href="index.html">首页</a> <a href="issue_material.html">发料</a> <a href="return_material.html">退料</a> <a href="stock_management.html">库存管理</a> <a href="supply_material.html">补料申请</a> <a href="product_inbound.html">产品入库</a> </nav> <div class="container"> <h2>请输入入库产品信息</h2> <form action="submit_product_inbound.html" method="POST"> <div class="form-group"> <label for="productId">产品ID:</label> <input type="text" id="productId" name="productId" required> </div> <div class="form-group"> <label for="productName">产品名称:</label> <input type="text" id="productName" name="productName" required> </div> <div class="form-group"> <label for="quantity">入库数量:</label> <input type="number" id="quantity" name="quantity" required> </div> <div class="form-group"> <label for="supplier">供应商:</label> <input type="text" id="supplier" name="supplier" required> </div> <div class="form-group"> <label for="inboundDate">入库日期:</label> <input type="date" id="inboundDate" name="inboundDate" required> </div> <div class="form-group"> <label for="comments">备注:</label> <textarea id="comments" name="comments"></textarea> </div> <button type="submit">提交入库申请</button> </form> </div> </body> </html>
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>退料申请</title> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet"> <style> body { font-family: 'Roboto', sans-serif; background-color: #f7f7f7; margin: 0; padding: 0; } header { background-color: #2a87f0; color: white; padding: 20px; text-align: center; font-size: 30px; } nav { background-color: #333; padding: 12px 0; text-align: center; } nav a { color: white; margin: 0 20px; text-decoration: none; font-size: 16px; } nav a:hover { background-color: #575757; padding: 10px 20px; border-radius: 5px; } .container { width: 60%; max-width: 800px; margin: 40px auto; padding: 20px; background-color: #fff; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } h2 { text-align: center; font-size: 28px; margin-bottom: 20px; } .form-group { margin-bottom: 20px; } label { font-size: 16px; display: block; margin-bottom: 5px; } input[type="text"], input[type="number"], textarea { width: 100%; padding: 12px; border-radius: 5px; border: 1px solid #ddd; font-size: 16px; } button { width: 100%; padding: 14px; background-color: #2a87f0; border: none; border-radius: 5px; color: white; font-size: 18px; cursor: pointer; margin-top: 20px; } button:hover { background-color: #1a6fc5; } </style> </head> <body> <header> 退料申请 </header> <nav> <a href="index.html">首页</a> <a href="issue_material.html">发料</a> <a href="return_material.html">退料</a> <a href="stock_management.html">库存管理</a> </nav> <div class="container"> <h2>请选择需要退回的物料</h2> <form action="submit_return_request.html" method="POST"> <div class="form-group"> <label for="materialId">物料ID:</label> <input type="text" id="materialId" name="materialId" required> </div> <div class="form-group"> <label for="quantity">退料数量:</label> <input type="number" id="quantity" name="quantity" required> </div> <div class="form-group"> <label for="reason">退料原因:</label> <textarea id="reason" name="reason" required></textarea> </div> <button type="submit">提交退料申请</button> </form> </div> </body> </html>
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>库存管理</title> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet"> <style> body { font-family: 'Roboto', sans-serif; background-color: #f7f7f7; margin: 0; padding: 0; } header { background-color: #2a87f0; color: white; padding: 20px; text-align: center; font-size: 30px; } nav { background-color: #333; padding: 12px 0; text-align: center; } nav a { color: white; margin: 0 20px; text-decoration: none; font-size: 16px; } nav a:hover { background-color: #575757; padding: 10px 20px; border-radius: 5px; } .container { width: 60%; max-width: 800px; margin: 40px auto; padding: 20px; background-color: #fff; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } h2 { text-align: center; font-size: 28px; margin-bottom: 20px; } </style> </head> <body> <header> 库存管理 </header> <nav> <a href="index.html">首页</a> <a href="issue_material.html">发料</a> <a href="return_material.html">退料</a> <a href="stock_management.html">库存管理</a> <a href="supply_material.html">补料申请</a> </nav> <div class="container"> <h2>当前库存情况</h2> <table border="1" cellpadding="10" style="width: 100%; border-collapse: collapse;"> <thead> <tr> <th>物料ID</th> <th>物料名称</th> <th>库存数量</th> </tr> </thead> <tbody> <tr> <td>001</td> <td>螺丝</td> <td>500</td> </tr> <tr> <td>002</td> <td>电池</td> <td>300</td> </tr> </tbody> </table> </div> </body> </html>
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>补料申请</title> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet"> <style> body { font-family: 'Roboto', sans-serif; background-color: #f7f7f7; margin: 0; padding: 0; } header { background-color: #2a87f0; color: white; padding: 20px; text-align: center; font-size: 30px; } nav { background-color: #333; padding: 12px 0; text-align: center; } nav a { color: white; margin: 0 20px; text-decoration: none; font-size: 16px; } nav a:hover { background-color: #575757; padding: 10px 20px; border-radius: 5px; } .container { width: 60%; max-width: 800px; margin: 40px auto; padding: 20px; background-color: #fff; border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } h2 { text-align: center; font-size: 28px; margin-bottom: 20px; } .form-group { margin-bottom: 20px; } label { font-size: 16px; display: block; margin-bottom: 5px; } input[type="text"], input[type="number"], textarea { width: 100%; padding: 12px; border-radius: 5px; border: 1px solid #ddd; font-size: 16px; } button { width: 100%; padding: 14px; background-color: #2a87f0; border: none; border-radius: 5px; color: white; font-size: 18px; cursor: pointer; margin-top: 20px; } button:hover { background-color: #1a6fc5; } </style> </head> <body> <header> 补料申请 </header> <nav> <a href="index.html">首页</a> <a href="issue_material.html">发料</a> <a href="return_material.html">退料</a> <a href="stock_management.html">库存管理</a> <a href="supply_material.html">补料申请</a> </nav> <div class="container"> <h2>请输入需要补充的物料信息</h2> <form action="submit_supply_request.html" method="POST"> <div class="form-group"> <label for="materialId">物料ID:</label> <input type="text" id="materialId" name="materialId" required> </div> <div class="form-group"> <label for="quantity">补料数量:</label> <input type="number" id="quantity" name="quantity" required> </div> <div class="form-group"> <label for="reason">补料原因:</label> <textarea id="reason" name="reason" required></textarea> </div> <button type="submit">提交补料申请</button> </form> </div> </body> </html>
标签:color,padding,background,测试代码,20px,font,margin From: https://www.cnblogs.com/lijianlongCode13/p/18671504