Skip to content

White background styling on <img> makes transparent images and alt text unreadable #27241

Closed
@glmvc

Description

@glmvc

MDN URL

https://developer.mozilla.org/en-US/docs/Web/Performance/Animation_performance_and_frame_rate

What specific section or headline is this issue about?

https://developer.mozilla.org/en-US/docs/Web/Performance/Animation_performance_and_frame_rate#css_property_cost

What information was incorrect, unhelpful, or incomplete?

Following line of CSS is causing images with transparency being nearly unreadable (in this case)
.main-page-content img {background: #fff}

If images are not loaded/found, the alt text is not visible either (dark theme)...

The border property within this rule looks also weird in this case, but this might be a global design decision.

What did you expect to see?

The images are readable without the white background (also the alt text in dark mode).

The white background probably had or has some purpose; or maybe not?

I don't know what's the best solution here. Just adapting the images? But of course it can be that this problem occurs with other images as well...

The (font) color should also be set, if a background property is present?

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

current view:
Screenshot 2023-06-09 at 19 59 27

without the background set to white:
Screenshot 2023-06-09 at 19 59 32

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions