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

Add support for width and height for Source Element #48

Open
alexander-schranz opened this issue Nov 11, 2022 · 3 comments
Open

Add support for width and height for Source Element #48

alexander-schranz opened this issue Nov 11, 2022 · 3 comments
Labels

Comments

@alexander-schranz
Copy link
Member

alexander-schranz commented Nov 11, 2022

Not yet supported by all major browser but still validate for w3c validator:

https://caniuse.com/mdn-api_htmlsourceelement_width

<picture>
    <source srcset="test2.jpg" width="200" height="200">

    <img src="test.jpg" alt="hello" width="200" height="400">
</picture>

The question is should a width and height even written when it is the same aspect ratio as the original file as that would just bloat the html with unnecessary informations.

@FlorianBoe
Copy link

Width and Height attributes on the source element are now supported in all current browsers since Firefox 108.

@mario-fehr
Copy link

@alexander-schranz is this not fixed with #46 ?

@alexander-schranz
Copy link
Member Author

alexander-schranz commented Apr 25, 2023

sizes and width and height are different attributes on the <source> tag:

and width and height is not implemented yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants