/* CSS代码示例:一个简单的网页布局 */
/* 设置body的背景颜色和字体 */
body {
background-color: #f0f0f0;
font-family: Arial, sans-serif;
}
/* 设置标题样式 */
h1 {
color: #333;
text-align: center;
}
/* 设置段落样式 */
p {
font-size: 16px;
line-height: 1.5;
margin: 20px;
}
/* 设置链接样式 */
a {
color: #007BFF;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
/* 设置按钮样式 */
.button {
display: inline-block;
padding: 10px 20px;
background-color: #007BFF;
color: white;
border-radius: 5px;
text-decoration: none;
}
.button:hover {
background-color: #0056b3;
}
/* 解释说明:
- body选择器设置了整个页面的背景颜色和字体。
- h1选择器设置了标题的颜色和居中对齐。
- p选择器设置了段落的字体大小、行高和外边距。
- a选择器设置了链接的颜色和去除下划线,a:hover设置鼠标悬停时的样式。
- .button类设置了按钮的基本样式,包括内边距、背景颜色、文本颜色、圆角等,并且定义了鼠标悬停时的效果。
*/
上一篇:css 数字换行
下一篇:css一行显示不下显示省略号
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站