border padding margin bg shadow font inline-block

本文深入探讨CSS中padding、margin的使用技巧,包括解决盒子高宽被撑大及外边距塌陷问题,同时介绍行内块元素的懒式写法与复杂样式如box-shadow、text-shadow的设置方法。

1. 设置padding 盒子高宽被撑大

在这里插入图片描述

2. margin 垂直外边距塌陷

  • 相邻
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>padding border margin</title>
	<style type="text/css">
		div.first {
			background: gray;
			width: 100px;
			height: 100px;
			margin-bottom: 20px;
		}
		div.two {
			background-color: blue;
			width: 100px;
			height: 100px;
			margin-top: 10px;
		}
	</style>
</head>
<body>
	<div class="first"></div>
	<div class="two"></div>
</body>
</html>

在这里插入图片描述

  • 嵌套
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>margin</title>
	<style type="text/css">
		.one {
			width: 200px;
			height: 200px;
			background-color: gray;
		}
		.two {
			margin-top: 60px;
			background-color: blue;
			width: 100px;
			height: 100px;
		}
	</style>
</head>
<body>
	<div class="one">
		<div class="two"></div>
	</div>
</body>
</html>

外盒子也跟着移动了

定义外盒子 border 或者padding 或者 overflow:hidden

3. 懒式写法

  • magin padding
    一个值:全部
    两个值: 上下 、左右
    三个值:上、左右、下
    四个值:上、右、下、左
  • border-radius
    一个值:全部
    两个值:左上右下、右上左下
    在这里插入图片描述
    三个值: 左上、右上左下、右下
    在这里插入图片描述
    四个值:左上、右上、右下、左下
  • 魔性 background 无顺序要求
background: transparent 50% 0  repeat-y url(L:\\1.png) scroll  ;
  • background-position 混合写
    background-position: 30px bottom;
    顺序从左到右依次: x坐标、y坐标
  • box-shadow
    box-shadow:水平阴影位置 垂直阴影位置 模糊距离(虚实) 阴影尺寸(影子大小) 阴影颜色 内/外阴影;
  • text-shadow
    text-shadow:水平位置 垂直位置 模糊距离 阴影颜色;
  • font
    选择器{font: font-style font-weight font-size/line-height font-family;}
    固定顺序,size和familiy必写

行内块

行内块水平居中 可以text-align:center 你知道吗

<!-- 全局样式 --> <style> :root { --primary-color: #5DB075; --primary-light: #E8F5E9; --secondary-color: #FFA000; --accent-color: #4285F4; --text-primary: #333333; --text-secondary: #666666; --background: #FFFFFF; --card-bg: #FAFAFA; --border-radius: 12px; --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); } /* 按钮样式 */ .btn { border-radius: 20px; padding: 10px 20px; font-weight: 500; border: none; transition: all 0.3s ease; } .btn-primary { background-color: var(--primary-color); color: white; } .btn-secondary { background-color: var(--secondary-color); color: white; } .btn-accent { background-color: var(--accent-color); color: white; } .btn-outline { background-color: transparent; border: 1px solid var(--primary-color); color: var(--primary-color); } /* 卡片样式 */ .card { background-color: var(--card-bg); border-radius: var(--border-radius); box-shadow: var(--box-shadow); padding: 16px; margin-bottom: 16px; } /* 导航栏 */ .nav-bar { background-color: white; box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05); } .nav-item { color: var(--text-secondary); font-size: 12px; } .nav-item.active { color: var(--primary-color); } /* 进度条 */ .progress-bar { height: 8px; border-radius: 4px; background-color: #EEEEEE; } .progress-fill { height: 100%; border-radius: 4px; background-color: var(--primary-color); } /* 评估项标签 */ .assessment-tag { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 12px; margin-right: 8px; } .tag-social { background-color: #E3F2FD; color: #1976D2; } .tag-language { background-color: #F1F8E9; color: #689F38; } .tag-science { background-color: #FFF8E1; color: #FFA000; } .tag-health { background-color: #FFEBEE; color: #D32F2F; } .tag-art { background-color: #F3E5F5; color: #7B1FA2; } /* 表单元素 */ .input-field { border: 1px solid #E0E0E0; border-radius: var(--border-radius); padding: 12px; width: 100%; margin-bottom: 16px; } .radio-group { margin-bottom: 16px; } .radio-option { display: flex; align-items: center; margin-bottom: 8px; } .radio-option input { margin-right: 8px; } /* 头像样式 */ .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; } /* 教师信息卡片 */ .teacher-card { background: linear-gradient(135deg, var(--primary-light), white); border-radius: var(--border-radius); padding: 16px; display: flex; align-items: center; margin-bottom: 16px; } .teacher-info { margin-left: 16px; } /* 幼儿列表项 */ .child-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #F5F5F5; } .child-name { font-weight: 500; } /* 评估记录项 */ .record-item { padding: 12px 0; border-bottom: 1px solid #F5F5F5; } .record-title { font-weight: 500; margin-bottom: 4px; } .record-time { color: var(--text-secondary); font-size: 12px; } /* 操作按钮组 */ .action-buttons { display: flex; justify-content: flex-end; margin-top: 8px; } .action-btn { margin-left: 8px; padding: 4px 8px; font-size: 12px; border-radius: 4px; } /* 观察记录区域 */ .observation-area { background-color: var(--primary-light); border-radius: var(--border-radius); padding: 16px; margin-bottom: 16px; } /* AI助手按钮 */ .ai-assistant { display: flex; align-items: center; background-color: var(--accent-color); color: white; padding: 8px 16px; border-radius: 20px; margin-top: 8px; } .ai-icon { margin-right: 8px; } </style> 帮我演示这段代码
05-06
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>圣遗物属性发送 - 逍遥网络</title> <style> :root { --primary-color: #4CAF50; --primary-hover: #45a049; --secondary-color: #f8f9fa; --text-color: #333; --light-text: #6c757d; --border-color: #ced4da; --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); --transition: all 0.3s ease; --error-color: #dc3545; --warning-color: #ffc107; --info-color: #17a2b8; --purple-color: #6f42c1; } * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: linear-gradient(135deg, rgba(245, 247, 250, 0.9) 0%, rgba(195, 207, 226, 0.9) 100%); color: var(--text-color); line-height: 1.6; display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; } .container { width: 100%; max-width: 1100px; background-color: rgba(255, 255, 255, 0.95); border-radius: 10px; box-shadow: var(--box-shadow); padding: 20px; } .header { text-align: center; margin-bottom: 20px; } h1 { color: var(--text-color); margin-bottom: 10px; font-weight: 600; text-shadow: 1px 1px 2px rgba(0,0,0,0.1); } .nav-tabs { display: flex; background: var(--secondary-color); border-radius: 8px; padding: 5px; margin-bottom: 20px; flex-wrap: wrap; } .nav-tab { flex: 1; padding: 12px 20px; text-align: center; background: none; border: none; cursor: pointer; border-radius: 6px; transition: var(--transition); font-weight: 500; min-width: 120px; } .nav-tab.active { background: var(--primary-color); color: white; } .tab-content { display: none; } .tab-content.active { display: block; } form { background-color: rgba(255, 255, 255, 0.9); padding: 30px; border-radius: 10px; box-shadow: var(--box-shadow); transition: var(--transition); } form:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); } .form-group { margin-bottom: 20px; } label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-color); } input[type="text"], input[type="password"], input[type="number"], select { width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 16px; transition: var(--transition); background-color: var(--secondary-color); } input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2); } .attribute_entry { background-color: rgba(248, 249, 250, 0.8); padding: 15px; border-radius: 6px; margin-bottom: 15px; border: 1px dashed var(--border-color); position: relative; } .attribute_entry label { display: inline-block; margin-right: 10px; margin-bottom: 0; } .attribute_entry select, .attribute_entry input[type="number"] { width: auto; min-width: 200px; margin-right: 10px; } .remove_attribute { background-color: var(--error-color); color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; font-size: 14px; transition: var(--transition); } .remove_attribute:hover { background-color: #c82333; } .btn { padding: 12px 24px; border: none; border-radius: 6px; cursor: pointer; font-size: 16px; transition: var(--transition); font-weight: 500; margin: 5px; } .btn-primary { background-color: var(--primary-color); color: white; } .btn-primary:hover { background-color: var(--primary-hover); } .btn-info { background-color: var(--info-color); color: white; } .btn-info:hover { background-color: #138496; } .btn-warning { background-color: var(--warning-color); color: var(--text-color); } .btn-warning:hover { background-color: #e0a800; } .btn-purple { background-color: var(--purple-color); color: white; } .btn-purple:hover { background-color: #5a359a; } input[type="submit"] { width: 100%; padding: 15px; background-color: var(--primary-color); color: white; border: none; border-radius: 6px; font-size: 18px; font-weight: 500; cursor: pointer; transition: var(--transition); margin-top: 20px; } input[type="submit"]:hover { background-color: var(--primary-hover); transform: translateY(-2px); } .inputBox { text-align: center; margin-top: 20px; } .inputBox a { color: var(--primary-color); text-decoration: none; font-weight: 500; transition: var(--transition); } .inputBox a:hover { text-decoration: underline; color: var(--primary-hover); } #divMsg { text-align: center; margin-top: 15px; color: var(--light-text); font-size: 14px; } .note { font-size: 14px; color: var(--light-text); margin-top: 5px; font-style: italic; } .sdk-result { margin-top: 20px; padding: 15px; border-radius: 6px; text-align: center; display: none; } .sdk-result.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; } .sdk-result.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; } .sdk-code { font-family: 'Courier New', monospace; font-size: 18px; font-weight: bold; background: #2c3e50; color: white; padding: 10px; border-radius: 4px; margin: 10px 0; letter-spacing: 1px; } .sdk-codes-list { max-height: 300px; overflow-y: auto; margin: 15px 0; padding: 10px; background: #f8f9fa; border-radius: 6px; border: 1px solid var(--border-color); } .sdk-code-item { padding: 8px; margin: 5px 0; background: white; border-radius: 4px; border-left: 4px solid var(--primary-color); } .table-container { overflow-x: auto; margin-top: 20px; background: white; border-radius: 8px; box-shadow: var(--box-shadow); } table { width: 100%; border-collapse: collapse; } th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border-color); } th { background: var(--secondary-color); font-weight: 600; } .status-used { color: var(--error-color); font-weight: bold; } .status-unused { color: var(--primary-color); font-weight: bold; } .batch-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; } .batch-count { width: 100px; } .form-actions { display: flex; gap: 10px; margin-top: 20px; } .form-actions .btn { flex: 1; } @media (max-width: 768px) { form { padding: 20px; } .nav-tab { min-width: 100px; padding: 10px 15px; font-size: 14px; } .attribute_entry select, .attribute_entry input[type="number"] { width: 100%; margin-bottom: 10px; } .attribute_entry label { display: block; margin-bottom: 5px; } .form-actions { flex-direction: column; } .batch-controls { flex-direction: column; align-items: stretch; } .batch-count { width: 100%; } } </style> </head> <body> <div class="container"> <div class="header"> <h1>圣遗物兑换系统</h1> <div class="inputBox"> </div> </div> <!-- 兑换CDK标签页 --> <div id="sdk" class="tab-content active"> <form id="redeemForm"> <div class="form-group"> <label for="redeem_uid">UID:</label> <input type="text" id="redeem_uid" name="uid" required placeholder="请输入您的UID"> </div> <div class="form-group"> <label for="sdk_code">CDK兑换码:</label> <input type="text" id="sdk_code" name="sdk_code" required placeholder="请输入12位CDK兑换码"> <div class="note">请输入12位大写字母和数字组成的CDK码</div> </div> <input type="hidden" name="action" value="redeem_sdk"> <input type="submit" value="兑换装备" class="btn btn-primary"> </form> <div id="divMsg">BY 逍遥网络 2025</div> <div id="redeemResult" class="sdk-result"></div> </div> </div> <script> // 标签页切换 function switchTab(tabName) { // 隐藏所有标签内容 document.querySelectorAll('.tab-content').forEach(tab => { tab.classList.remove('active'); }); // 移除所有标签的激活状态 document.querySelectorAll('.nav-tab').forEach(tab => { tab.classList.remove('active'); }); // 显示选中的标签内容 document.getElementById(tabName).classList.add('active'); // 激活选中的标签 event.target.classList.add('active'); // 如果是管理标签页,自动加载SDK列表 if (tabName === 'manage') { loadSDKList(); } } // 加载物品数据 function loadItems() { fetch('syxywl.cn-syw.txt') .then(response => response.text()) .then(data => { const lines = data.split('\n'); const selects = document.querySelectorAll('#item_id, #sdk_item_id, #batch_item_id'); selects.forEach(select => { // 清空现有选项(保留第一个提示选项) while (select.options.length > 1) { select.remove(1); } lines.forEach(line => { if (line.trim() !== '') { const [value, text] = line.split(':'); const option = document.createElement('option'); option.value = value; option.textContent = text; select.appendChild(option); } }); }); }) .catch(error => console.error('加载物品数据失败:', error)); } // 加载主属性数据 function loadMainProps() { fetch('sx1-zsx.txt') .then(response => response.text()) .then(data => { const lines = data.split('\n'); const selects = document.querySelectorAll('#mainPropId, #sdk_mainPropId, #batch_mainPropId'); selects.forEach(select => { // 清空现有选项(保留第一个提示选项) while (select.options.length > 1) { select.remove(1); } lines.forEach(line => { if (line.trim() !== '') { const [value, text] = line.split(':'); const option = document.createElement('option'); option.value = value; option.textContent = text; select.appendChild(option); } }); }); }) .catch(error => console.error('加载主属性数据失败:', error)); } // 加载属性数据 function loadAttributes() { fetch('sx2-fsx.txt') .then(response => response.text()) .then(data => { const lines = data.split('\n'); const selects = document.querySelectorAll('.attr-select'); selects.forEach(select => { // 清空现有选项(保留第一个提示选项) while (select.options.length > 1) { select.remove(1); } lines.forEach(line => { if (line.trim() !== '') { const [value, text] = line.split(':'); const option = document.createElement('option'); option.value = value; option.textContent = text; select.appendChild(option); } }); }); }) .catch(error => console.error('加载属性数据失败:', error)); } // 页面加载完成后初始化数据 document.addEventListener('DOMContentLoaded', function() { loadItems(); loadMainProps(); loadAttributes(); // 绑定表单提交事件 document.getElementById('redeemForm').addEventListener('submit', handleRedeemSubmit); }); // 处理兑换SDK表单提交 function handleRedeemSubmit(e) { e.preventDefault(); const formData = new FormData(this); fetch('send_item.php', { method: 'POST', body: formData }) .then(response => response.json()) .then(data => { const resultDiv = document.getElementById('redeemResult'); resultDiv.className = 'sdk-result ' + (data.success ? 'success' : 'error'); resultDiv.textContent = data.message; resultDiv.style.display = 'block'; if (data.success) { this.reset(); setTimeout(() => { resultDiv.style.display = 'none'; }, 5000); } }) .catch(error => { console.error('Error:', error); const resultDiv = document.getElementById('redeemResult'); resultDiv.className = 'sdk-result error'; resultDiv.textContent = '网络错误,请重试'; resultDiv.style.display = 'block'; }); } </script> </body> </html> 优化显示UI 适配手机电脑平板
最新发布
11-30
```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> <style> * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Microsoft YaHei', sans-serif; } body { background-color: #f5f5f5; color: #333; line-height: 1.6; } .container { max-width: 800px; margin: 0 auto; padding: 20px; } header { text-align: center; margin-bottom: 30px; padding-bottom: 15px; border-bottom: 2px solid #e74c3c; } h1 { color: #e74c3c; font-size: 2.2rem; margin-bottom: 10px; } .description { color: #666; font-size: 0.9rem; } .input-section { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); margin-bottom: 20px; } .form-group { margin-bottom: 15px; } label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; } input, textarea, select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; } textarea { height: 100px; resize: vertical; } button { background-color: #e74c3c; color: white; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-size: 1rem; transition: background-color 0.3s; } button:hover { background-color: #c0392b; } .search-section { background: white; padding: 15px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); margin-bottom: 20px; } .records-section { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } .record-item { padding: 15px; border-bottom: 1px solid #eee; position: relative; } .record-item:last-child { border-bottom: none; } .record-title { font-weight: bold; font-size: 1.1rem; color: #e74c3c; margin-bottom: 5px; } .record-content { margin-bottom: 8px; color: #555; } .record-meta { display: flex; justify-content: space-between; font-size: 0.85rem; color: #888; } .record-category { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 0.8rem; margin-right: 8px; } .delete-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; color: #999; cursor: pointer; font-size: 1.2rem; } .delete-btn:hover { color: #e74c3c; } .empty-state { text-align: center; padding: 30px; color: #999; } .category-work { background-color: #e8f4fd; color: #2980b9; } .category-life { background-color: #f0f8e8; color: #27ae60; } .category-relationship { background-color: #fde8f0; color: #e84393; } .category-other { background-color: #f8f8f8; color: #7f8c8d; } </style> </head> <body> <div class="container"> <header> <h1>记仇小本本</h1> <p class="description">记录那些不该忘记的事情,但请记住:宽容是美德,放下是智慧</p> </header> <section class="input-section"> <div class="form-group"> <label for="title">事件标题</label> <input type="text" id="title" placeholder="简要描述事件..."> </div> <div class="form-group"> <label for="content">详细内容</label> <textarea id="content" placeholder="详细描述发生了什么..."></textarea> </div> <div class="form-group"> <label for="category">分类</label> <select id="category"> <option value="work">工作相关</option> <opt
11-27
<!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>高三勇者大冒险:终极备考RPG指南</title> <style> /* 游戏风格基础设置 */ :root { --quest-blue: #4e73df; --epic-purple: #6f42c1; --rare-green: #1cc88a; --common-gray: #858796; --legendary-orange: #f6c23e; --health-red: #e74a3b; --mana-blue: #36b9cc; --stamina-yellow: #f6c23e; --dark-bg: #2a3042; --light-text: #f8f9fc; } @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Noto+Sans+SC:wght@400;700&display=swap'); body { background-color: var(--dark-bg); color: var(--light-text); font-family: 'Noto Sans SC', sans-serif; line-height: 1.6; background-image: url('https://img.freepik.com/free-vector/pixel-art-game-background-nature-landscape_107791-740.jpg'); background-size: cover; background-attachment: fixed; padding: 0; margin: 0; } .rpg-container { max-width: 1000px; margin: 0 auto; background-color: rgba(42, 48, 66, 0.9); border: 4px solid var(--epic-purple); border-radius: 10px; box-shadow: 0 0 30px rgba(110, 66, 193, 0.5); overflow: hidden; } /* 游戏标题样式 */ .rpg-header { background: linear-gradient(135deg, var(--quest-blue), var(--epic-purple)); padding: 30px; text-align: center; position: relative; border-bottom: 5px solid var(--legendary-orange); } .rpg-title { font-family: 'Press Start 2P', cursive; font-size: 2.2rem; color: white; text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; margin-bottom: 15px; letter-spacing: 2px; } .rpg-subtitle { font-size: 1.2rem; color: rgba(255,255,255,0.8); font-weight: bold; } /* 角色状态栏 */ .character-status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 15px; background-color: rgba(0,0,0,0.3); border-bottom: 2px solid var(--quest-blue); } .status-bar { display: flex; flex-direction: column; align-items: center; } .status-label { font-size: 0.8rem; color: var(--light-text); margin-bottom: 5px; } .status-value { font-weight: bold; font-size: 1.2rem; } .health { color: var(--health-red); } .mana { color: var(--mana-blue); } .stamina { color: var(--stamina-yellow); } .level { color: var(--rare-green); } /* 任务日志区域 */ .quest-log { padding: 20px; } .chapter-title { font-family: 'Press Start 2P', cursive; font-size: 1.2rem; color: var(--legendary-orange); margin: 30px 0 20px; padding-bottom: 10px; border-bottom: 2px dashed var(--epic-purple); text-shadow: 2px 2px 0 #000; } /* 任务卡片样式 */ .quest-card { background: linear-gradient(135deg, rgba(46, 52, 78, 0.8), rgba(32, 38, 58, 0.8)); border: 2px solid var(--quest-blue); border-radius: 8px; padding: 15px; margin-bottom: 20px; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.3); transition: transform 0.3s; } .quest-card:hover { transform: translateY(-5px); border-color: var(--rare-green); } .quest-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } .quest-name { font-weight: bold; font-size: 1.1rem; color: white; display: flex; align-items: center; } .quest-type { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; margin-left: 10px; } .main-quest { background-color: var(--epic-purple); } .daily-quest { background-color: var(--quest-blue); } .skill-quest { background-color: var(--rare-green); } .event-quest { background-color: var(--legendary-orange); color: #000; } .quest-rewards { display: flex; } .reward { margin-left: 10px; font-size: 0.8rem; background-color: rgba(0,0,0,0.3); padding: 3px 8px; border-radius: 4px; border: 1px solid var(--common-gray); } .quest-description { margin: 10px 0; line-height: 1.5; } .quest-objectives { margin-top: 15px; } .objective { display: flex; align-items: center; margin-bottom: 8px; padding-left: 25px; position: relative; } .objective:before { content: "◻"; position: absolute; left: 5px; color: var(--common-gray); } .objective.completed:before { content: "✓"; color: var(--rare-green); } /* 技能树样式 */ .skill-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; margin-top: 20px; } .skill-card { background-color: rgba(32, 38, 58, 0.8); border: 2px solid var(--common-gray); border-radius: 8px; padding: 15px; transition: all 0.3s; } .skill-card:hover { border-color: var(--rare-green); box-shadow: 0 0 15px rgba(28, 200, 138, 0.3); } .skill-name { font-weight: bold; color: white; margin-bottom: 5px; display: flex; justify-content: space-between; } .skill-level { color: var(--legendary-orange); } .skill-description { font-size: 0.9rem; color: rgba(255,255,255,0.7); } .cooldown { margin-top: 10px; font-size: 0.8rem; color: var(--mana-blue); } /* 游戏底部区域 */ .rpg-footer { text-align: center; padding: 20px; background-color: rgba(0,0,0,0.5); border-top: 2px solid var(--epic-purple); } .save-button { background: linear-gradient(135deg, var(--rare-green), #17a673); color: white; border: none; padding: 12px 25px; font-size: 1.1rem; font-weight: bold; border-radius: 50px; cursor: pointer; box-shadow: 0 5px 15px rgba(28, 200, 138, 0.4); transition: all 0.3s; } .save-button:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(28, 200, 138, 0.6); } /* 响应式设计 */ @media (max-width: 768px) { .character-status { grid-template-columns: repeat(2, 1fr); } .rpg-title { font-size: 1.5rem; } .skill-tree { grid-template-columns: 1fr; } } </style> </head> <body> <div class="rpg-container"> <div class="rpg-header"> <h1 class="rpg-title">高三勇者大冒险</h1> <p class="rpg-subtitle">终极备考RPG指南 · 2025届黄金版</p> </div> <div class="character-status"> <div class="status-bar"> <span class="status-label">生命值</span> <span class="status-value health">❤️ 85/100</span> </div> <div class="status-bar"> <span class="status-label">专注力</span> <span class="status-value mana">🔵 70/100</span> </div> <div class="status-bar"> <span class="status-label">耐力</span> <span class="status-value stamina">🟡 90/100</span> </div> <div class="status-bar"> <span class="status-label">等级</span> <span class="status-value level">⭐ Lv.5</span> </div> </div> <div class="quest-log"> <h2 class="chapter-title">第一章: 新手村准备</h2> <div class="quest-card"> <div class="quest-header"> <span class="quest-name">装备你的武器库 <span class="quest-type main-quest">主线任务</span> </span> <div class="quest-rewards"> <span class="reward">EXP +200</span> <span class="reward">金币 +500</span> </div> </div> <div class="quest-description"> 收集并整理你的学习装备:五科笔记本、错题本、历年真题集、彩色标记笔。记得定期维护你的装备! </div> <div class="quest-objectives"> <div class="objective completed">购买各科笔记本</div> <div class="objective completed">准备错题本系统</div> <div class="objective">收集近5年真题</div> <div class="objective">建立文具补给包</div> </div> </div> <h2 class="chapter-title">第二章: 每日修行</h2> <div class="quest-card"> <div class="quest-header"> <span class="quest-name">晨读的智慧 <span class="quest-type daily-quest">每日任务</span> </span> <div class="quest继续完成代码
05-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值