html - CSS背景属性在chrome和firefox中不起作用
问题描述
我的html代码如下。我用 Chrome 和 Firefox 测试了它。在这两种浏览器中,第一个 div 的背景颜色都不起作用。
.box-orange {
// without any position declaration
background: orange;
height: 100px;
width: 100px;
border: 1px solid blue;
}
.box-red {
background: green;
height: 100px;
width: 100px;
border: 1px solid red;
}
<html>
<head>
</head>
<body>
<div class="box-orange"></div>
<div class="box-red"></div>
</body>
</html>
谁能告诉我问题出在哪里?
解决方案
删除注释,导致css代码中错误注释的原因应该是这样的/*your comment*/
推荐阅读
- c# - 如何防止 WMPLib.WindowsMediaPlayer 在计算机休眠时停止播放音乐?
- r - 如何从其 cdf 不是封闭形式的分布中生成数据?
- spring-boot - Spring Boot webflux - 验证配置属性
- google-sheets - 谷歌表格上流通股的历史数据
- elasticsearch - 使用 axios elasticsearch 发布 bulk.json
- html - 如何正确显示这个角度日历的日期?
- visual-studio-code - VS Code - 如何关闭自动启动
- tensorflow - 如果我使用 VRAM 不足的显卡训练大型深度学习模型会怎样?
- r - 如何手动匹配left_join不匹配的单元格?
- json - ' ' 类型的值没有下标 - JSON 数据