Home > Enterprise >  why an aqua color zone is not showing using css?
why an aqua color zone is not showing using css?

Time:06-19

I created a class zone to show an aqua color zone, but it does not show.

  .zone{
            background-color: aqua;
            margin: 10px;
            height: 100 px;
        }
aqua zone 
<div ></div>

CodePudding user response:

Remove to space between the 100 and px and the background colour will show too - and as per the last answer, move text inside the opening and closing div tags.

.zone {
  background-color: aqua;
  margin: 10px;
  height: 100px;
}
<div >
aqua zone
</div>

CodePudding user response:

Your content, or your text in this case, is outside of the div that you're styling so the div essentially serves no purpose. You need to move your text into that div to get what you're looking for

.zone {
  background-color: aqua;
  margin: 10px;
  height: 100px;
}
<div >aqua zone
</div>

  • Related