DEV Community

12 Common HTML Mistakes to Avoid for Better Code Quality

Vaibhav Kumar on May 12, 2023

HTML is the backbone of the web, and mastering it is essential for any web developer. However, even the most experienced developers can make mist...
Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Funny how this article is much newer than ChatGPT, and yet that still generates mostly the same headings and descriptions when prompted, and even starts with the phrase "HTML is the backbone of the web".

Collapse
 
devxvaibhav profile image
Vaibhav Kumar

I know I used Chat GPT, but it was not used for anything wrong or illegal I used it spread knowledge 😄

Collapse
 
thumbone profile image
Bernd Wechner

Ah, but did you properly credit and reference it? Quietly playing the game that suggests you are the originating author? The very dilemma that the new wave of AI represents.

Thread Thread
 
devxvaibhav profile image
Vaibhav Kumar

Does chat GPT says to give credit and reference?? I am not playing any game I am just using chatGPT to do something which can be useful for everyone, including me too.

Thread Thread
 
thumbone profile image
Bernd Wechner • Edited

You need ChatGPT to tell you to honestly credit the actual author? Seriously? You don't find that openness, transparency and honesty are useful ethics in this modern world of ours, as to your sources? Well, I think you do value honesty which is good (as you admitted to it in response to an observation that "Funny how this article is much newer than ChatGPT, and yet that still generates mostly the same headings and descriptions when prompted, and even starts with the phrase "HTML is the backbone of the web").

I recommend strongly you do cite your references and sources and credit them when publishing, it is a standard publication ethic and I predict it may come back to bite you if you fail to honour it over time.

Thread Thread
 
devxvaibhav profile image
Vaibhav Kumar

okay for sure i will remember this

Collapse
 
fruntend profile image
fruntend

Сongratulations 🥳! Your article hit the top posts for the week - dev.to/fruntend/top-10-posts-for-f...
Keep it up 👍

Collapse
 
devxvaibhav profile image
Vaibhav Kumar

Thank you very much 🤞

Collapse
 
punund profile image
punund

tag don't have to be closed in this context:

<div> foo
  <p> bar
</div>
Enter fullscreen mode Exit fullscreen mode

This is valid HTML.

Collapse
 
devxvaibhav profile image
Vaibhav Kumar

the HTML code you provided is not valid is because the <p> tag is not closed before the closing </div> tag.

Collapse
 
punund profile image
punund

Let me refer you to the HTML specification:

Tag omission in text/html:
A p element's end tag can be omitted if the p element is immediately followed by an address, article, aside, blockquote, details, div, dl, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, main, menu, nav, ol, p, pre, search, section, table, or ul element, or if there is no more content in the parent element and the parent element is an HTML element that is not an a, audio, del, ins, map, noscript, or video element, or an autonomous custom element.

html.spec.whatwg.org/multipage/gro...

Thread Thread
 
devxvaibhav profile image
Vaibhav Kumar

oh now i see, thank you for pointing out 🤞