/* CSS 样式模板 */
/* 1. 重置样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* 2. 基本样式 */
body {
font-family: Arial, sans-serif;
line-height: 1.6;
background-color: #f4f4f4;
color: #333;
}
/* 3. 容器样式 */
.container {
width: 80%;
margin: auto;
overflow: hidden;
}
/* 4. 标题样式 */
h1, h2, h3 {
text-align: center;
margin-bottom: 20px;
}
/* 5. 段落样式 */
p {
margin: 10px 0;
}
/* 6. 按钮样式 */
button {
display: inline-block;
padding: 10px 20px;
background: #007BFF;
color: white;
border: none;
cursor: pointer;
text-align: center;
}
button:hover {
background: #0056b3;
}
/* 7. 导航栏样式 */
nav ul {
list-style-type: none;
padding: 0;
}
nav ul li {
display: inline;
margin-right: 10px;
}
nav ul li a {
text-decoration: none;
color: #333;
}
nav ul li a:hover {
color: #007BFF;
}
/* 8. 表格样式 */
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
table, th, td {
border: 1px solid #ddd;
}
th, td {
padding: 12px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
* 选择器将所有元素的 margin 和 padding 设置为 0,并设置 box-sizing 为 border-box,以确保一致的盒模型行为。body 设置字体、行高、背景颜色和文本颜色,确保页面有一个统一的基础样式。.container 类,用于创建居中的内容区域,并防止内容溢出。h1, h2, h3 设置居中对齐和底部间距,使标题更加美观。p 设置上下间距,使段落之间的间距适中。ul) 和链接 (a) 设置样式,使其水平排列并添加悬停效果。这个模板涵盖了常见的 CSS 样式,适用于大多数网页设计需求。
上一篇:css渐变色背景
下一篇:css important的用法
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站