Remove padding beneath heading tag

前端 未结 5 1355
时光说笑
时光说笑 2021-01-07 19:22

Currently I have a list that has an H3 heading above it (which I can\'t really remove easily, it\'s auto generated by a cms) and looks something like this

He         


        
5条回答
  •  佛祖请我去吃肉
    2021-01-07 19:56

    H1, H2, and H3 tags all inherently have a margin and padding added to them by browsers.

    You can test this by putting a background on the H1, H2, and H3 tags in css and looking in different browsers.

    To remove the "pipe spacing" you should:

    h3{
        padding: 0px;
        margin: 0px;
    }
    

    Then you can re-add whatever you would like since CSS is a one-way execution path. Consequent CSS values will overwrite base-level CSS.

提交回复
热议问题