Over time just writing code holds very little value, that is because it is no more efficient, and loses modularity. Writing clean code becomes very essential.
Some good practices while writing HTML are listed below:
Start with DOCTYPE
DOCTYPE is required for activating standard mode.
Bad: Good:
<!DOCTYPE html>
...
...
-
don't put white spaces around tags and attribute values.
Bad:HTML Best Practices
Good:
HTML Best Practices
3.Don’t omit the closing tag
It is always a good practice to close all opened tags and in the same order.
Bad: Good:
... ...
4.Don’t mix character cases
Either have them written in UPPER case on in the lower case. It gives consistency also.
Bad:
General
Good:
General
Also Good:
General
5.Don’t mix tag for CSS and JavaScript
Sometimes script element blocks construction.
Bad:
Good:
Also good:
6.Use main element
main element can be used wrapping contents.Not use
Bad: ...
Good:
...
These practices make error rectification much easier and also helps with accessing elements easily
Top comments (2)
Your formatting is unfortunately not very readable. Maybe you want to look at the Markdown documentation: github.com/adam-p/markdown-here/wi...
sure
Some comments may only be visible to logged-in visitors. Sign in to view all comments.