##############################
Best Practices
##############################
As we discussed earlier, HTML is a very forgiving language. This makes it incredibly easy to make a mistake that doesn't appear in your browser, but breaks the website for other browsers.
Personally, when I develop websites I check on them with **Chrome**, as its the most popular browser by far. As of February 2020, W3Schools reports chrome browsers are 82% of their page visits, with the next most used browser being Firefox at 8.7%.
W3Schools releases the statistics every month, and we can clearly see Firefox losing ground to Chrome.
`See browser usage statistics here `_
Once the feature I'm working on is complete, I also check the website with Firefox. At the end of the project, or if reliability is critical, I also check the website with IE, Opera and Safari.
Included in the following link is a list of all the common mistakes that can be made when coding HTML, as most browsers will still display the correct thing.
`A list of best practices `_
**An important note**: On the page above, they mention **not** to use a trailing slash on self-closing tags.
As with many things on the web, this is a highly debated topic, still ongoing today. I prefer the trailing slash to ensure backwards compatibility with older HTML, and also to me it looks more logical in a document.
It's fine to not use the trailing slash, and this is a great first lesson in web best practices.
.. highlights:: **The most important best practice is consistency. It doesn't matter which way you do things in HTML, but it is very important that you pick a style and stick with it.**
Some examples that you will certainly encounter in the future:
- Indents (tabs or spaces? how many spaces?)
- Naming classes/variables (camelCase? underscores? hyphens?)
- Self closing tags (trailing slash? Omit it? Use a closing tag?)
As you learn more about the web, you will encounter many decisions that you need to make. Many people will tell you their "right" way to do things, as I have, but the truth is the only thing that matters is **consistency with your chosen style**.
Congratulations! You've completed the Fundamentals of HTML. You are now equipped with the knowledge of how the structure of websites work, and should be well equipped to discuss these concepts with others.
If you'd like to start coding HTML and become a web developer, I suggest you give the excellent codecademy HTML course a go. It's an 8 hour interactive course where you will practice and learn every part of HTML required to build your own websites.
`Learn HTML by doing `_
That is all for this Web fundamentals course for now. I hope that some day in the future I will have the passion to write out the rest of this course.
..
Continue the Web fundamentals course by learning how to make your HTML pages look beautiful. The next course is all about CSS: The style of the web.