Search code examples
htmlcssbackground-color

css background property not working in chrome and firefox


My html code is as follows. I tested it with both Chrome and Firefox. In both the browsers the first div's background color is not working.

.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>

Can anyone tell me where is the issue?


Solution

  • Remove the comment, its what is causing the error comments in css code should be like this /*your comment*/