Category: Programming | Posted date: 2021-07-04 22:58:51 | Posted by: Admin
HTML may sound easy to developers but do you that there are probably still few mistakes you do. Let's see what are those mistakes to avoid.
HTML is probably the preparatory stage for Web Developers. It stands for HyperText Markup Language. It is a markup language that provides how the texts in a document will be formatted and laid out. It is basically the skeleton of a website; you can imagine a human skeleton and the face and physical features would be the CSS and how that person functions and behaves is the JavaScript.
As easy as it sounds, and surely every developer knows HTML, mistakes are still inevitable.
Here are some of the few mistakes that you can easily avoid as long as you keep it in mind - or if not, you’ll soon realize it for sure
- If you encountered an error whereas your codes are not running properly or completely broken, this mistake is where that leads into. Think of it as confirming the code you wrote to be executed. But properly closing a tag means you also put the closing tag on the right place, make sure to not include unnecessary codes within before you close.
- Developers, especially beginners, treat doctype as a tag; which is UNTRUE. Doctype is an essential part and/or line in your code as it informs the browser about the document type to accept. This is a MUST for every HTML page you are working on. You don’t wanna miss and forget doctype before coding.
- Surely, all websites contain images. Also, for sure, developers skipped writing alt attributes for these images. This is a common mistake which I know sounds unnecessary as the website can still work properly without having an alt attribute. But developers should note that Alt text helps improve accessibility and topical relevance. On top of that, it can also help you rank in Google Images.
- This may seem very confusing, but every developer should practice the clean code principles. CSS is the one responsible for executing style codes. Don’t take other people’s jobs. Although this is not entirely wrong, sometimes it just doesn’t make sense.
- Inline elements reside in these blocks, such as anchor and spam tags. So you should never put blocks inside inline elements.
- I know right., I mean: Why not? Well, as the majority of developers got used to using <b> and <i>, being semantically correct is a plus for a clean code. Instead, use <strong> and <em> for bolding and italicizing.
- Line break tag <br> is a very useful tag to make spaces between your elements or texts. But its use can get overrated. The truth is, you shouldn’t use line break <br> to add gaps between elements. There’s a better way to do this, you can split the paragraphs into separate spaces or rows by writing them in their own individual tags <p></p>.
You might wanna ask, these are just small mistakes that don't really produce serious problems, why bother? The answer is, a good developer knows that each line, element and tag used in a code matters. This may be small mistakes, but now that you know that these are mistakes, it’s now up to you if you want to correct them or code wrong. Keep your ego or be better.