Just some daily habits in HTML coding we all should get rid off.
Using type attribute for <script> and <style>
❌ Stop writi...
For further actions, you may consider blocking this person and/or reporting abuse
Really, really well written with great, detailed, practical examples. This is 1 in a 1,000. Excellent work. Thank you!
One question re: Using type attribute for and <style>, you say that modern browsers are smart enough to understand. What should we consider modern browsers?</p>
Glad you liked it, Doug!
Specifically for the
type
attribute, it's not required since HTML5. And since HTML5 was released in 2008, I'm pretty sure all browsers support it, means thetype
attribute is deprecated for a long time actually.What about self-closing tags? We don't need "/" at the end. Self-closing tags do not exist in HTML.
Yep, you're right Paweł, correctly noticed!
Great article, thank you! I love the CSS accordions, I've seen a few examples but never this comprehensive.
As a big advocate for minimal js, I'll be using this in future 👍
Might be hard to make people use a
dialog
if they do even basic navigation using JS but I agree most JS isn't needed if plain HTML can do it.Thanks :)
Lovely code examples to back up the points, thanks for the effort!
Glad it was helpful for you 😊
Bru that was actually really good! ☺️
Great article. There are some things I should change in my practice!
I'm pretty sure that should be html5shi*m*.js
A shiv is an improvised knife, whereas a shim is literally a small wedge of wood inserted to fix some woodwork, which I think is a closer metaphor.
The etymology is correct, but the project is actually called html5shi*v*.
github.com/aFarkas/html5shiv
After having spent most of my employment dealing with the ever more obnoxious quirks of IE because Microsoft left it to rot and corporations wouldn't pull it off their desktops, I'm just fine with the name "shiv" in this case, as it's goal is to brutally stab IE until it acknowledges some understanding of HTML5.
Well,
<script type>
might be needed when you want to put the module script on the site.Like this:
Sure, I meant if you include a regular script there's no need to provide "text/javascript" for it.
ok,谢谢你
I was always confused about using HTML5 header and footer elements on a page. Now I understand that we can use them multiple times in relation to their ancestor elements.
Thanks!
I read somewhere that it is only advisable to add the ="1" when writing for XML not HTML since XML is more strict than HTML. What do you say?
In that case, the correct syntax is actually 'disabled="disabled"' or the like - in XHTML, all of the boolean attributes are either present with a value equal to their local name, or absent.
Any non-validating parser isn't going to care, and any user is actually checking for the existence of the attribute, not the value of the attribute..