Skip to content

Added example for sizes attribute #40017

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Added example for sizes attribute #40017

wants to merge 11 commits into from

Conversation

jvlavan
Copy link
Contributor

@jvlavan jvlavan commented Jun 21, 2025

Description

Clarified how the sizes attribute works with srcset, including a detailed explanation and example of how it helps the browser choose the optimal image based on screen size and device pixel ratio. Also added notes on browser-specific behavior when resizing.

Motivation

The sizes attribute was previously referenced but not properly introduced or explained, which could confuse readers unfamiliar with how responsive images work. This change helps users understand why sizes is important, how it affects image selection from srcset, and what to expect across different browsers.

Additional details

Related issues and pull requests

Fixes #39689

@jvlavan jvlavan requested a review from a team as a code owner June 21, 2025 20:20
@jvlavan jvlavan requested review from estelle and removed request for a team June 21, 2025 20:20
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs size/s [PR only] 6-50 LoC changed labels Jun 21, 2025
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Jun 21, 2025

Preview URLs

(comment last updated: 2025-06-25 16:53:45)

jvlavan and others added 4 commits June 22, 2025 01:55
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jvlavan jvlavan marked this pull request as draft June 25, 2025 17:07
@jvlavan jvlavan marked this pull request as ready for review June 25, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML Hypertext Markup Language docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sizes referred to but not introduced nor explained nor shown in examples
2 participants