看不到背景颜色 css



名为:codeContainer的类没有显示background-color。我想应该在菜单栏下面。然而,我如何调整背景颜色或定位,使其显示?

http://jsfiddle.net/5qd5bL7o/

<div class="codeContainer" id="htmlContainer">
ssd
</div>
<style> .codeContainer { background-color: blue; height: 100%; width: 50%; 
float: left; } </style>

问题就在这里:

<!-- to clear the floats -->

这是一个HTML注释,使你的CSS无效。CSS注释是这样的:

/* to clear the floats */

这不是CSS中唯一出现错误注释的地方,你应该修复它们。

最新更新