jensimmons / cssremedy

Start your project with a remedy for the technical debt of CSS.
Mozilla Public License 2.0
2.19k stars 112 forks source link

vertical-align and alt text #66

Open tigt opened 5 years ago

tigt commented 5 years ago

Originally from #14:

I ran into an issue recently with img { vertical-align: middle } at work.

If an image breaks and falls back to its alt text, a vertical-align other than baseline produces different behavior across browsers. Here’s a CodePen to demonstrate.

  • Older (current?) versions of Firefox have the alt text dip below the baseline
  • As of Firefox Nightly 71.0a1, though, the changing of vertical-align appears to be ignored and the text flows on the same baseline, which seems ideal to me.
  • Chrome has the same problem as older Firefox, along with a broken image icon

Is it worth trying to fix this problem with selectors specifically for alt text? (Like img:is(:-moz-broken, :-moz-loading, :-moz-user-disabled))

Malvoz commented 4 years ago

This could hopefully be handled using standardized properties in the future, see related issues: