how to use no margin image side image in html, css

2019-08-19 14:27发布

问题:

I want to show this four images without any margin. How to do this?

Each A,B,C,D look like one image.

A
B
C
D

<div align="center">
    <img src="a.png">
    <br/>
    <img src="b.png">
    <br/>
    <img src="c.png">
    <br/>
    <img src="d.png">
</div>

I tried css margin=0 and style padding =0 but it is not working.

Update---

<img id="ImgEmotion" src="a.png" width="40" border="0">
<img src="b.png" width="20" height="20" border="0">

If I use css, I know there are no margin.

If I use #no_margin, how can I apply to img tag? Also I need the 'id='ImgEmotion'.

回答1:

CSS:

img 
{
    margin:0; 
    display:block
}

HTML:

<div align="center">
    <img src="a.png">
    <img src="b.png">
    <img src="c.png">
    <img src="d.png">
</div>

JSFIDDLE