How to remove image padding that is showing up unintentionally?

前端 未结 2 355
渐次进展
渐次进展 2021-01-04 16:17

I have three images in a container that should be stacked seamlessly, but there is some padding occurring between them.

You can see the page here: http://www.arbiter

相关标签:
2条回答
  • 2021-01-04 16:29

    Another option to resolve the same problem is

    #mainBoxFull{ font-size:0; }
    

    it'll ignore all the white spaces in between. + you can se font size where ever you have the text.

    0 讨论(0)
  • 2021-01-04 16:43

    The problem is, that images are inline-blocks. That is, spaces between them are counted. These spaces occur as padding to you. Use

    #mainBoxFull img { display: block; }
    

    and the problem should vanish. Alternatively, you can remove the white space in the source HTML between the div and the img elements (all white space).

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