Home Web Front-end CSS Tutorial Solution to the gap between img pictures inserted into li_CSS/HTML

Solution to the gap between img pictures inserted into li_CSS/HTML

May 16, 2016 pm 12:03 PM
img li

Add style directly img{vertical-align:bottom; display:block}

Of course, it doesn't work in some cases. For example, I want to add three pictures, top, middle and bottom. The middle picture is set as the background. I found that this method is invalid. It's just that the gaps between the top and middle pictures are gone, and the bottom and middle pictures are gone. There is still something in between. The method is very simple. Change vertical-align:bottom to top. You can set the parameters of vertical-align according to the different situations you encounter.

Method 1:

Copy code The code is as follows:

img{vertical-align:top; display:block }

Solution to the gap between img pictures inserted into li_CSS/HTML

Copy code The code is as follows:


Method 2: Set container font-size:0 (I personally think this method is the best!!!)

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to open img file How to open img file Sep 18, 2023 am 09:40 AM

How to open img file

How to open img file How to open img file Jul 06, 2023 pm 04:17 PM

How to open img file

What is the format of img? What is the format of img? Mar 17, 2023 am 10:33 AM

What is the format of img?

What element is li? What element is li? Aug 03, 2023 am 11:19 AM

What element is li?

What is li in html What is li in html Nov 19, 2021 pm 03:31 PM

What is li in html

U disk pe cannot read img U disk pe cannot read img Mar 19, 2024 pm 12:07 PM

U disk pe cannot read img

what does image tag mean in html what does image tag mean in html Mar 04, 2021 pm 02:37 PM

what does image tag mean in html

How to change the src attribute of img in jquery How to change the src attribute of img in jquery Mar 03, 2022 pm 03:41 PM

How to change the src attribute of img in jquery

See all articles