在html中,设置背景颜色的代码是“31bdd5bb123e616efb783f76e2611460”,style属性用于设置元素的样式,“background-color”属性用于设置元素的背景颜色。
本教程操作环境:windows10系统、html5版、dell g3电脑。
html5设置背景色是哪个代码
在html中,可以利用style属性与background-color属性来设置元素的背景颜色。
style 属性规定元素的行内样式(inline style),style 属性将覆盖任何全局的样式设定,例如在 c9ccee2e6ea535a969eb3f532ad9fe89 标签或在外部样式表中规定的样式。
background-color 属性设置元素的背景颜色。
background-color 属性为元素设置一种纯色。这种颜色会填充元素的内容、内边距和边框区域,扩展到元素边框的外边界(但不包括外边距)。如果边框有透明部分(如虚线边框),会透过这些透明部分显示出背景色。
示例如下:
<!doctype html><html lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>document</title></head><body> <input type="text" style="background-color:pink"></body></html>
输出结果:
推荐教程:《html视频教程》
以上就是html5设置背景色是哪个代码的详细内容。
