Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

line-height property on html element alters elements #57

Closed
jferrettiboke opened this issue Nov 2, 2017 · 3 comments
Closed

line-height property on html element alters elements #57

jferrettiboke opened this issue Nov 2, 2017 · 3 comments

Comments

@jferrettiboke
Copy link

Description

The line-height property on html element is altering the element heights.

There is a workaround that works for me. If I set line-height to 0 on the html element, it is solves the issue but I think this should be fixed on the core.

Reproduction

To show you up what I am talking about, I created a parent div with a background color which contains a img.

<div class="bg-blue">
  <img src="https://images.unsplash.com/photo-1472491235688-bdc81a63246e?auto=format&fit=crop&w=200" alt="Cat">
</div>

wrong

Expected

It should not alter the height of my div at all. In other words, the blue area should not appear.

@LostKobrakai
Copy link

Images are inline elements by default and are placed in the baseline, see here: https://jsfiddle.net/62fk1dc8/
To prevent this behaviour set the image to display: block

@jferrettiboke
Copy link
Author

Alright! I forgot that... 😅 Thanks @LostKobrakai.

@adamwathan
Copy link
Member

Thanks for helping @LostKobrakai! Gonna close this since this is just normal CSS behavior.

DCzajkowski pushed a commit to DCzajkowski/tailwindcss that referenced this issue Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants