Member-only story
“MEDIA” The HTML Attribute Nobody Seems To Want To Use
And possibly the most important part of using HTML and CSS properly.
I have said for nearly twenty years that the lack of the MEDIA attribute — or setting media=”all”
— on a stylesheet <link>
or <style>
tag is an indication of developer ignorance, incompetence, and ineptitude. It is one of the many signs that the person writing the HTML and CSS aren’t qualified to use HTML any time after 1998. I take it even further and say that if in the stylesheet you see a media query containing “screen and” it too is stupid, since that determination should already have been made long before the browser parsed the stylesheet!
But people keep asking what is it, and why is it so important? More so, a lot of developers seem to bury their heads in the sand going “wah wah, is not!” refusing to even try to use it, continuing the “screen only screw everyone else’ attitude.
A situation made only worse by lies and disinformation like the clowns saying “it was only added for media queries” when it actually predates them by a decade and a half. Seriously the nonsense some people make up out of nowhere!
So What Does It Do?
It’s very simple, and it plays to one of the entire reasons HTML is separate from CSS. It says…