Jump to content

Very Quick Easy Html Question That Ive Always Wondered..


yandoo

Recommended Posts

Hi there I have wondered something about html for ages and hope you could answer it for me.

 

Ive noticed in html some tages close with a / and others dontg, yet they produce the same result..

 

For example with tags on META data:

<META name"description" content="text of stuff and things">

<META name"description" content="text of stuff and things"/>

 

Another example is the br tag:

 

<br>
<br/>

 

Whats the best method for the closing tag? The / or not the slash?

 

Thank you for elevating me to a new sense of awareness :)

This is one of the differences between using HTML and XHTML. While self-closing tags are optional in HTML, they're required in XHTML. If you're using HTML it's up to you, but it is considered best practise to close all of your HTML tags still.

This is one of the differences between using HTML and XHTML. While self-closing tags are optional in HTML, they're required in XHTML. If you're using HTML it's up to you, but it is considered best practise to close all of your HTML tags still.

 

In HTML 4.01 Strict, the W3C Validation Service will produce warnings and errors if the "self-closing" tag is used. This style is defined for XHTML and HTML5

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.