<!DOCTYPE html>
<html>
<head>
<title>设置背景颜色示例</title>
<style>
/* 使用CSS设置body的背景颜色为浅蓝色 */
body {
background-color: lightblue;
}
</style>
</head>
<body>
<h1>这是一个设置了背景颜色的网页</h1>
<p>通过在<style>标签中定义body的background-color属性,可以轻松地为整个页面设置背景颜色。</p>
</body>
</html>
<style>
标签中,我们使用了CSS来设置body
元素的background-color
属性。background-color: lightblue;
这一行代码将页面的背景颜色设置为浅蓝色。lightblue
为其他颜色名称或颜色代码(如#RRGGBB
格式的颜色值)。上一篇:html下拉列表
下一篇:html color
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站