Why is my background color not showing if I have display: inline?

后端 未结 6 2074
臣服心动
臣服心动 2020-12-11 15:30

    
       

test

<
6条回答
  •  既然无缘
    2020-12-11 16:03

    The issue is you have an H3, a blocking element, inside of the inline element.

    You can see what's happening with:

    h3
    {
        background-color: inherit;   
    }
    

    or make H3 inline:

    h3
    {
     display: inline;   
    }
    

提交回复
热议问题