validator icon indicating copy to clipboard operation
validator copied to clipboard

Error: Attribute media not allowed on element source at this point.

Open dschuessler opened this issue 1 year ago • 0 comments

URL being validated or code to reproduce error:

<!DOCTYPE html>
<html lang="en">
  <title>Test</title>
  <video autoplay loop muted playsinline>
    <source media="(orientation: landscape)" src="/fish-desktop.mp4">
    <source media="(orientation: portrait)"  src="/fish-mobile.mp4">
  </video>
</html>
Error: Attribute media not allowed on element [source](https://html.spec.whatwg.org/multipage/#the-source-element) at this point.

[From line 5, column 5; to line 5, column 69](https://validator.w3.org/nu/#l5c69)

line>↩    <source media="(orientation: landscape)" src="/fish-desktop.mp4">↩    <

The media attribute on source elements inside video elements is allowed again since 2023.

This is also reflected in the specs.

dschuessler avatar Mar 23 '25 19:03 dschuessler