When working on a recent project, I found that there was always a blank space below when referencing pictures, as shown in the figure below. <style> .img-box { border: 2px solid red; width: 550px; } </style> <div class="img-box"> <img src="./img.png" alt=""> </div> Later I found out that the reason is that the inline block elements will be aligned with the text baseline. To solve this problem is actually very simple, there are two main methods: 1. Add vertical-align: middle | top | bottom, etc. to the image. (Recommended) img { vertical-align: bottom; } 2. Convert the image to a block-level element display: block; (Converting block-level elements may affect your layout, so the first method is recommended) g { display: block; } Well, the problem is solved so simply. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Vue custom directive details
>>: MySQL data table partitioning strategy and advantages and disadvantages analysis
1. Create a new user: 1. Execute SQL statement to...
Table of contents Preface toDoList just do it Pre...
Prerequisite: Save the .frm and .ibd files that n...
Table of contents 1. props 2..sync 3.v-model 4.re...
This article shares the installation steps and us...
Often, after a web design is completed, the desig...
I installed node to the D drive, and I also neede...
Table of contents 1. v-text text rendering instru...
1. CSS file naming conventions Suggestion: Use le...
Table of contents Usage scenarios How to achieve ...
Table of contents 1. Overview 2. Define a simple ...
Table of contents Scenario Effect Code Summarize ...
Table of contents 1. What is the life cycle 2. Lo...
eureka: 1. Build a JDK image Start the eureka con...
This article shares the specific code for JavaScr...