
html中body元素用于背景颜色的属性是什么?
body元素用于设置背景颜色的属性是bgcolor。
语法:
bgcolor属性用于规定文档的背景颜色
立即学习“前端免费学习笔记(深入)”;
示例:
<html>
<body bgcolor="#E6E6FA">
<p><a href="http://www.w3school.com.cn">W3School.com.cn</a></p><div class="aritcle_card flexRow">
<div class="artcardd flexRow">
<a class="aritcle_card_img" href="/ai/1345" title="智川X-Agent"><img
src="https://img.php.cn/upload/ai_manual/000/000/000/175679972846726.png" alt="智川X-Agent" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a href="/ai/1345" title="智川X-Agent">智川X-Agent</a>
<p>中科闻歌推出的一站式AI智能体开发平台</p>
</div>
<a href="/ai/1345" title="智川X-Agent" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span> </a>
</div>
</div>
<p><a href="http://www.w3school.com.cn/html/">HTML Tutorial</a></p>
</body>
</html>兼容性注释
在 HTML 4.01 中,不赞成使用 body 元素的 bgcolor 属性;在 XHTML 1.0 Strict DTD 中,不支持 body 元素的 bgcolor 属性。
请使用 CSS 代替。
CSS 语法:
推荐教程: 《HTML教程》










