What are the major points we need to follow in making html pages validated

Updated on:19 Jun 2020, 17:15pm IST

In this tutorial you will learn how you can validate your webpage and what are the major mistakes you should avoid in writing the code.

Team Markup Infinity

As a beginner, there are lots of chances that you will make mistake in writing HTML code. Unsufficient knowledge of code strtucture will cause the page behave differently in each browsers.

To prevent this you will have to follow the guidelines and standards set by the W3C (Wide Web Consortium) for HTML web pages.

The World Wide Web Consortium provide a simple online tool (https://validator.w3.org/) where you can check you webpage’s validation. There are three ways of validating the webpages which are as follows.

1. Validate by URI

What Are The Top Things in Making HTML Pages Validated

2. Validate by File Upload

What Are The Top Things in Making HTML Pages Validated

3. Validate by Direct Input

What Are The Top Things in Making HTML Pages Validated

What mistakes we should avoid:

1. Alt Tags

Most of the times, lots of developers forget to write the alt in img tag, if we do not write this tag, web page does not validate and it also affects your SEO.

Wrong Practise

<img src="images/logo.png" />

Correct Practise

<img src="images/logo.png" alt="Name" />

2. Element div not allowed as child of element span

We should always remember that we can not put element div inside the span elements, this always throws an error and it’s not a good practise.

Wrong Practise

<span><div></div></span>

Correct Practise

<div><span></span></div>

3. The type attribute is unnecessary for JavaScript resources

We should avoid using type=”text/script” for calling jquery codes because HTML5 doesn’t need this.

Wrong Practise

<script type='text/javascript' src='jquery.js></script>

Correct Practise

<script type='text/javascript' src='jquery.js></script>

If you are a beginner and wants to try your hand in Full Stack Development, then must check out remotestack.io

user

Team Markup Infinity

Technology is such a broad kind of term, it really applies to so many things, from the electric light to running cars on oil. All of these different things can be called technology.