Give a Background Color to a Div Element


你可以用 background-color 属性来设置一个元素的背景颜色。

例如,如果你想把一个元素的背景颜色设置为green,你应该把这些加到你的 style 元素中:

.green-background {
  background-color: green;
}

创建一个叫做 gray-background 的类选择器,设置其 background-color 为 gray,最后应用到 div 元素。

给div元素设置背景颜色

相关文章:

  • 2021-09-19
  • 2021-12-21
  • 2021-08-05
  • 2021-12-12
  • 2021-11-04
  • 2022-01-14
  • 2021-12-27
猜你喜欢
  • 2021-06-03
  • 2021-11-23
  • 2021-05-02
  • 2022-12-23
  • 2021-10-12
  • 2021-05-18
  • 2021-04-21
相关资源
相似解决方案