简单 CSS 代码:设置背景色和标题样式
以下是一段简单的 CSS 代码,用于设置一个网页的背景色和标题样式:
body {
background-color: #f6f6f6;
}
h1 {
font-size: 36px;
font-weight: bold;
color: #333;
text-align: center;
margin-top: 50px;
}
这段代码将网页的背景色设置为浅灰色(#f6f6f6),并将标题(h1 元素)的字体大小设置为 36 像素,加粗字体,黑色文字,居中对齐,顶部和底部有 50 像素的空白。您可以根据需要进行调整。
原文地址: https://www.cveoy.top/t/topic/nYvx 著作权归作者所有。请勿转载和采集!