Skip to main content
Added w3c link
Source Link

You should get into a habit of adding the protocol to your anchors, as it can sometimes lead to confusing effects, such as in this case:

<a href="www.website.com">Website!</a>

Let's say, the site where that code is on is called http://www.mywebsite.com/mypage.php

Guess where you would go when clicking the <a>? You would be directed to the address http://www.mywebsite.com/www.website.com instead of the intended http://www.website.com

Also, if you are going to do XTHML or HTML5, you should close your IMG tags like this:
<img src="logo.jpg" alt="This is the company logo" />
Notice the '/' in the end.

The same applies to any tags that do not use a closing tag:
<p>This has a closing tag</p>
<input type="text" name="textField" value="No closing tag in me!" />

A very good tool for testing your HTML is the official validator from W3C: http://validator.w3.org

You should get into a habit of adding the protocol to your anchors, as it can sometimes lead to confusing effects, such as in this case:

<a href="www.website.com">Website!</a>

Let's say, the site where that code is on is called http://www.mywebsite.com/mypage.php

Guess where you would go when clicking the <a>? You would be directed to the address http://www.mywebsite.com/www.website.com instead of the intended http://www.website.com

Also, if you are going to do XTHML or HTML5, you should close your IMG tags like this:
<img src="logo.jpg" alt="This is the company logo" />
Notice the '/' in the end.

The same applies to any tags that do not use a closing tag:
<p>This has a closing tag</p>
<input type="text" name="textField" value="No closing tag in me!" />

You should get into a habit of adding the protocol to your anchors, as it can sometimes lead to confusing effects, such as in this case:

<a href="www.website.com">Website!</a>

Let's say, the site where that code is on is called http://www.mywebsite.com/mypage.php

Guess where you would go when clicking the <a>? You would be directed to the address http://www.mywebsite.com/www.website.com instead of the intended http://www.website.com

Also, if you are going to do XTHML or HTML5, you should close your IMG tags like this:
<img src="logo.jpg" alt="This is the company logo" />
Notice the '/' in the end.

The same applies to any tags that do not use a closing tag:
<p>This has a closing tag</p>
<input type="text" name="textField" value="No closing tag in me!" />

A very good tool for testing your HTML is the official validator from W3C: http://validator.w3.org

Source Link

You should get into a habit of adding the protocol to your anchors, as it can sometimes lead to confusing effects, such as in this case:

<a href="www.website.com">Website!</a>

Let's say, the site where that code is on is called http://www.mywebsite.com/mypage.php

Guess where you would go when clicking the <a>? You would be directed to the address http://www.mywebsite.com/www.website.com instead of the intended http://www.website.com

Also, if you are going to do XTHML or HTML5, you should close your IMG tags like this:
<img src="logo.jpg" alt="This is the company logo" />
Notice the '/' in the end.

The same applies to any tags that do not use a closing tag:
<p>This has a closing tag</p>
<input type="text" name="textField" value="No closing tag in me!" />