If you are a webpage developer, you always make use of HTML coding but you do sometimes confront with simple coding mistakes. Both skilled coders and learners commit errors in their HTML coding due to in attentiveness or absence of experience.
Clean code is really important as it not only makes you a proficient web developer,but additionally saves your time as you don’t need to edit the codes later on.
If your webpage has clean code, which implies that your html code holds the configuration indicated by the World Wide Web Consortium, maintaining the standard to be followed by the internet based websites, it will in turn help in augmenting your site’s ranking in Google too.
It always helps if you are careful from the very beginning as well as review your work before posting.
Here is a list of most common HTML coding mistakes that we often do and encounter.
1) Missing or inappropriate DOCTYPE
DOCTYPE or Document Type Definition (DTD) lets your web browser identifies which version of HTML your webpage is using. The HTML code should always start with the DOCTYPE as it statesthe rules for a particular HTML version.
You should be careful while typing the DOCTYPE, as it is case sensitive and it different DOCTYPE refers to different version of HTML. Check this video: How do I make sure my HTML code doesn’t have mistakes in it?
2) Incorrectly formatted HTML
The most common error while writing HTML code is formatting it incorrectly, such as missing closing tag, omitting quotation marks for attribute values and inappropriate nesting of tags.
Usually most of the HTML tags have both opening and closing tag for e.g. <b> as well as </b>. If a tag surrounds any content, then it should be closed, though there are some exceptions, like <p> tag, but it is always advisable to close that tag to as it will make editing your HTML document easier.
It is always better to put quotes around values, although it is not compulsory in older version of HTML, the latest versions do need it. Closing a tag properly is also a very important part of HTML coding and it should be ended in the opposite direction of which it was opened.
3) Unsupported attributes or tags
Sometimes people tend to use codes like <MARQUEE> or <BLINK> that are not part of HTML standards. Again, many use attributes that are improper, such as tag that alter size of the margin in the <body>, for e.g. <body marginwidth=”1″>. Different versions of HTML support different types of attributes and tags.
If you want to be sure of which attributes are compatible to the version you are using, you ought to validate your HTML with HTML Validator.
4) Overlooking Character Encoding
Each character set has a particular code for it and the code tell the web browser which character set is being used in the web page. Thus, a web page consisting of English characters will possess a different character set than that of Chinese or French characters set.
As a result, the character encoding will suggest the web browser what type of information to read and display. In case of most of the English web pages, the character encoding windows-1252and ISO-8859-1signify English character.
5) Using multiple line break
It is inappropriate to use a line breaking tag <br> to insert gap between lines, as this should strictly be used to add only a single line break and not to create paragraphs and space between elements. The right way to use line break is: <p>This is one line</p> <p>This is a different line</p> Instead of: This is one line <br/> <br/> This is a different line.
6) Using inappropriate tables
Tables often lead to wrong HTML coding and it since most browsers donot show the error message if tables are encoded inappropriately, it is quite easy to do so. However, assistive technologies are real stern about correct table structure.The following are the most common table mistakes that we often do:
- Do not ending the <tr>, <td> or <table> tags or ending them incorrectly
- Enclosing rows or table cells with the tags used for text formatting.
- In each rows, making tables with varied number of cells.
- Creating tables within the inline elements, like – <h1> or <b>
7) Improperly formatted URLs
It does happen sometimes that you can see the linked words and/or the images but others cannot. You need to make sure that in the URL there is no DOS type pathname, like C:\image, otherwise whoever follows the link will get the Document Not Found Error 404. Again, it is always necessary to use the forward slash (/) and not the back slash (\), even when some server software acknowledge both, it is better to maintain the standard. In case of links, the extension could be a problem. While testing a file named mywebpage.htm may work perfectly but what the server needs is- mywebpage.html.
8) Overlooking <noscript>
It is important for any JavaScript that outputs data or performs a function should have a <noscript> tag, which deliver an alternative or description of what the JavaScript does.
9) Using <b> for bolding and <i> for italicizing
Semantically it is incorrect to use <i>smd<b> respectively for italicizing and bolding texts. For this purpose it is appropriate to use CSS properties for font-style and font-weight and if you have to use the styles in the document itself, then it is better to use <em> and <strong> to make the texts italics and bold.
10) Missing alt attributes in case of image tags
It is necessary for image tags to have alt attributes, as it explains the context of the image. If you use the alt attribute, the web crawlers will classify the contents better and it also facilitate the users to decide if the image is important or not.
This list can probably continue forever but all these points are enough to make you realize what you should be careful at while using HTML codes.
You should also validate your page to be acquainted with the HTML coding errors you are committing, so that you can easily avoid those to have clean coding.
What kind of mistakes you made in blogging
Hello Jitendra,
I have learned with html that it has to be just right. Usually when I have problems it is usually because I have made a mistake with the coding. I have had to learn html because as a blogger you need to be able to edit your site. At first I was a little scared to use it when I first started as I knew nothing about it but I just learned as I went along and that really was helpful to me.
Thanks for sharing this with us!
Hi Jitendra,
Human errors and mistakes cannot be completely eliminated. We only thrive for perfection as learners or experts.
Its helpful being reminded of these coding mistakes. Although I am not into programming but I think webmasters and bloggers should find this post helpful.
There are times when it would become necessary to apply a little coding skills to tweak and improve the performance of a blog or website.
Thanks for sharing this. I guess we would be on the watch out for these in the event that the blog or website suffers from coding errors. We then know what to correct and lookout for!
This post was found in kingged where it was shared and upvoted.