Home  >  Article  >  Web Front-end  >  How to cancel image interval in css

How to cancel image interval in css

藏色散人
藏色散人Original
2020-12-16 10:13:354313browse

How to cancel the image interval in css: first create an HTML sample file; then insert two images through the img tag; then write "font-size:0;" on the parent of the img tag; and finally set Just use the attribute "display:block".

How to cancel image interval in css

The operating environment of this tutorial: windows7 system, css3 version. This method is suitable for all brands of computers.

Recommended: "css video tutorial"

How to cancel the gap between img images

1. Write multiple img tags In one line

<img src="/i/eg_tulip.jpg"  alt="郁金香" height="100px"/>
<img src="/i/eg_tulip.jpg"  alt="郁金香" height="100px"/>

Effect:

How to cancel image interval in css

<img src="/i/eg_tulip.jpg"  alt="郁金香" height="100px"/><img src="/i/eg_tulip.jpg"  alt="郁金香" height="100px"/>

Effect:

How to cancel image interval in css

##2. In the img tag Write on the parent: font-size:0;//This is also helpful in solving the problem of display: inline-block

<div   style="max-width:90%">
   <img src="/i/eg_tulip.jpg"  alt="郁金香" height="100px"/>
   <img src="/i/eg_tulip.jpg"  alt="郁金香" height="100px"/>
</div>

Effect:

How to cancel image interval in css

3. Use display: block (img is an inline element) // It needs to float

<img src="/i/eg_tulip.jpg"  alt="郁金香" height="100px"   style="max-width:90%"/>
<img src="/i/eg_tulip.jpg"  alt="郁金香" height="100px"   style="max-width:90%"/>

Effect:

How to cancel image interval in css##4. Use letter-spacing Attribute

<div   style="max-width:90%"><!--letter-spacing的值无论是负多少都不会产生重叠-->
    <img src="/i/eg_tulip.jpg"  alt="郁金香" height="100px"/>
    <img src="/i/eg_tulip.jpg"  alt="郁金香" height="100px"/>
</div>

Effect:

The above is the detailed content of How to cancel image interval in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn