Recently, a friend asked me a question: When layout the page, I found that there is a 1-2 pixel blank space under the picture. How can I remove it? This is a browser design issue. img is originally an inline element, but it can use width and height. When the parent element does not set the height, problems such as 3px gap will appear when the height calculated by the height of the child elements is given to the parent element. Method 1 to remove the gap under the image img{display:block;} Method 2 img{vertical-align:top;} In addition to the top value, you can also set it to text-top | middle | bottom | text-bottom, or even specific <length> and <percentage> values. Method 3 #qdxw{font-size:0;line-height:0;} #qdxw is the parent element of img Summarize This concludes this article on how to use CSS to clear a few pixels of blank space under images. For more information on how to use CSS to clear a few pixels of blank space under images, please search previous articles on 123WORDPRESS.COM or continue browsing the related articles below. We hope that you will support 123WORDPRESS.COM in the future! |
<<: In-depth understanding of Mysql transaction isolation level and locking mechanism issues
>>: Detailed explanation of HTML programming tags and document structure
This article describes the sql_mode mode in MySQL...
I have seen a lot of MySQL-related syntax recentl...
1. Linux network configuration Before configuring...
Preface When I went to an interview at a company ...
Table of contents 1. What is a calculated propert...
Since I usually use the docker build command to g...
View mysqlbinlog version mysqlbinlog -V [--versio...
Share a Shell script under Linux to monitor the m...
This article example shares the specific code of ...
Today, when I was configuring Tomcat to access th...
1. HTML Image <img> 1. The <img> tag ...
Preface I recently installed MySQL 5.7 and found ...
Table of contents 1. MySQL data backup 1.1, mysql...
This article shares the specific code of vue+echa...
This article uses examples to illustrate the basi...