DIV Background color not showing with body color

后端 未结 1 1575
面向向阳花
面向向阳花 2021-01-07 08:56

I have set the body background color to the color of Light Grey#D6D6D6and I wish to have a div displayeing with the background color of light blue #2390bb

相关标签:
1条回答
  • 2021-01-07 09:17

    Following my comment:

    Your problem is the div has no content... no width/height... and so the blue color is not displayed.

    Use this in the css to avoid the gaps on the edges:

    #bg-top {
      background-color: #2390bb;
      position:absolute; 
      top:0;
      left:0;
      width: 100%;
      height: 200px;
    }
    

    Plz mark the answer as solution if this has helped you!

    0 讨论(0)
提交回复
热议问题