HTML例假周期树【女朋友生理期记录】
    		       		warning:
    		            这篇文章距离上次修改已过438天,其中的内容可能已经有所变动。
    		        
        		                
                以下是一个简单的HTML页面示例,用于记录女朋友的生理期:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>女朋友生理期记录</title>
    <style>
        body {
            font-family: Arial, sans-serif;
        }
        form {
            max-width: 300px;
            margin: 20px auto;
            padding: 20px;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }
        input[type="date"] {
            width: 100%;
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #ddd;
            border-radius: 5px;
        }
        button {
            width: 100%;
            padding: 10px;
            background-color: #5cb85c;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        button:hover {
            background-color: #449d44;
        }
    </style>
</head>
<body>
    <form id="lunar-cycle-form">
        <label for="start-date">开始日期:</label>
        <input type="date" id="start-date" name="start-date">
        <label for="end-date">结束日期:</label>
        <input type="date" id="end-date" name="end-date">
        <button type="submit">记录周期</button>
    </form>
 
    <script>
        const form = document.getElementById('lunar-cycle-form');
        form.addEventListener('submit', function(event) {
            event.preventDefault();
            const startDate = form.startDate.value;
            const endDate = form.endDate.value;
            // 在这里添加代码以保存日期范围到服务器或本地存储
            console.log('记录生理期从:', startDate, '到:', endDate);
            // 例如,可以使用 IndexedDB 或 localStorage 来保存数据
        });
    </script>
</body>
</html>这个页面使用了HTML5的<input type="date">来让用户选择日期,并使用JavaScript来处理表单提交,防止页面刷新。在实际应用中,你需要替换console.log部分,以实现与服务器的数据交互和存储。这个例子展示了如何创建一个简单的日期记录系统,并且可以根据需要进行扩展,比如添加数据验证或更复杂的UI。
评论已关闭