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

戏子无情 提交于 2019-12-11 21:07:54

问题


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



来源:https://stackoverflow.com/questions/16048480/how-to-use-no-margin-image-side-image-in-html-css

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!