How to cancel image interval in css

藏色散人
Release: 2020-12-17 16:36:17
Original
4342 people have browsed it

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"/>
Copy after login

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"/>
Copy after login

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>
Copy after login

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%"/>
Copy after login

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>
Copy after login

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!

Related labels:
css
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template