• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: White space above a vertically aligned inline-block element

Resolved: White space above a vertically aligned inline-block element

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Code




You can play and see the result here: https://jsfiddle.net/y1jkw3nu/5/

Problem


I have this weird empty space above the red square.

Question


Can someone explain to me where does this empty space come from? I understand that it’s because of font-size: 50px, but the .inner div have vertical-align: middle. Doesn’t it mean it should be positioned in the middle of the line?

Answer:

Thats because the ‘content’ inside reserves height for the text that could be there… put line-height:0 and its gone..


If you have better answer, please add a comment about this, thank you!

css html vertical-alignment
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to give rank on datetime column group by another column with userid in it

24/03/2023

Resolved: Passing 2 functions in onChange in react

24/03/2023

Resolved: Why doesn’t stringstream consume output during hex formatting?

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.