7 Common Mistakes to Avoid While Writing an HTML Assignment

Posted by Casey Floyd on July 1st, 2019

Not everyone is perfect in writing HTML codes, be it a professional programmer or just a beginner. There comes a point when everyone commits some common mistakes that ruin their whole code. So, before you do the same, it is better to know about these common mistakes so that you do not suffer later.
 
Want to know about these mistakes?

Just go through the following...
 
1.Not Using ALT-Tag for Image Tags
 The ALT tag is very necessary for IMG tags, as it is used to describe the context of the image. It clearly describes to the reader, whether the image is important or not. Most of the students commit this mistake that is, they do not use ALT tag for image tags and the reader does not clearly identify it. For example:
 
Mistake: <img src="profilepic.jpeg"/>
 
Here, the ALT tag is not used for the image tag, so it can be corrected in the following manner -
 
Correct: <img src="profilepic.jpeg" alt="Profile pic of the user"/>
 
Now, from the above code, the user can clearly identify that the image is the profile pic of the user.
 
2.Placing Block Elements Within Inline Statements
 An HTML element itself is displayed as a block by default. But, most of the students place block elements with the inline statements and that is not needed. The reason behind is, block elements such as div and paragraphs make up the complete structure of the document. The inline elements reside in these blocks so there is no need to place block element in it.
 
Take a look at the following example to know the difference -
 
Mistake: <a href="#"><h2>Block inside Inline</h2></a>
 
Correct: <h2><a href="#">Inline inside Block</a></h2>
 
3.Using Multiple Line Breaks
 
The <br> tag can only be used once to insert a single line break in paragraphs and is not used to make space between elements. Students use multiple line breaks in their HTML code which is not the right approach.  
 
For example:  
 
Mistake: This is a line
<br/>
<br/>
This is another line.
 
As you can see that, in the above example <br> tag is used two times, so we can correct it in the following manner -
 
Correct: <p>This is a line</p>
<p>This is another line</p>
 
Simple! Isn’t it?
 
4.Using Inline Styles
 We all know the fact that the main point of semantic HTML is to separate the document structure with styling. Then why using inline styles? It doesn’t make any sense to use inline styles in your HTML assignment. So, just avoid doing so. Have a look at the following example to see the difference -
 
Mistake: <h2 style="color : red;">Wrong</h2>
 
Correct: <h2>Right</h2> in HTML
h2. red{color : red;} in CSS
 
5.Adding and Removing the Border Attribute in HTML
 The border attribute is used to present something exceptional, so it can only be modified in CSS. So, the students should avoid it using in their HTML assignment.   
 
For example:
 
Mistake: <img src="mypic.png" border="0"/>
 
Correct: <img src="mypic.jpg"/>
 
6.Using Line Breaks to Show a List
 Almost every student gets confused about using line breaks and further commit mistakes. Remember, if you want to show a list using numbers then <br> tag is never use, instead, you should use a <ol> tag.
 
For example:
 
Mistakes:  
1. Steve Jobs<br/>
2. Bill Gates<br/>
3. Linus Torvalds
 
Correct:  
<ol>
<li>Steve Jobs</li>
<li>Bill Gates</li>
<li>Linus Torvalds</li>
</ol>
07/01/2019
7.Forget to Put the DOCTYPE
 
This is the mistake that will undoubtedly cost you your marks...
The DOCTYPE basically reflects what kind of HTML you are using and if you are not using it, how will your professor know that the code is valid or not. So, just avoid doing this silly mistake as it marks a negative impression on your professor. You can also take help of online HTML validator for it.
 
Final Thought!
 
HTML assignment writing is not a challenging job but what’s more challenging is to write it error-free. But, you can easily overcome it once you implement the following points in your assignment. Then definitely no one can stop you from getting A+ grades.
 
 
 About the Author: Casey Flyd is an academic writer at Global Assignment Help Australia. He has a keen interest in the programming part. His writing has helped thousands of students in completing their HTML programming assignment. In his leisure time, he loves to play football.

 

Like it? Share it!


Casey Floyd

About the Author

Casey Floyd
Joined: December 13th, 2017
Articles Posted: 11

More by this author