Skip to content

Conversation

@youssef-el-atmani
Copy link
Contributor

Include a note on the importance of setting width and height for effective object-fit application.

Description

I added a note about how to use the object-fit property effectively

Motivation

  • Because I lost a lot of time trying to understand why the object-fit property doesn't work on my personal examples, I did what the docs instruct, but that property fails to apply. And just later I discovered that I should set a height and width to the image in order for that object-fit to be applied effectively. I think that works the same for all the replaced-elements, but I only tested it for img elements.
  • Readers will be able to use that object-fit effectively.

Additional details

There is no clue or note about that even in the object-fit mdn-reference

Related issues and pull requests

Include a note on the importance of setting width and height for effective `object-fit` application.
@youssef-el-atmani youssef-el-atmani requested a review from a team as a code owner November 19, 2025 11:55
@youssef-el-atmani youssef-el-atmani requested review from dipikabh and removed request for a team November 19, 2025 11:55
@github-actions github-actions bot added Content:Learn Learning area docs size/s [PR only] 6-50 LoC changed labels Nov 19, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

Preview URLs

Flaws (5)

URL: /en-US/docs/Learn_web_development/Core/Styling_basics/Images_media_forms
Title: Images, media, and form elements
Flaw count: 5

  • macros:
    • Macro produces link /en-US/docs/Web/CSS/max-width which is a redirect
    • Macro produces link /en-US/docs/Web/CSS/object-fit which is a redirect
    • Macro produces link /en-US/docs/Web/CSS/object-fit which is a redirect
    • Macro produces link /en-US/docs/Web/CSS/object-fit which is a redirect
    • Can't resolve /en-US/curriculum/

(comment last updated: 2025-11-19 12:20:24)

…edia_forms/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added size/xs [PR only] 0-5 LoC changed and removed size/s [PR only] 6-50 LoC changed labels Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Learn Learning area docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant