Jump to content

Very Quick Easy Html Question That Ive Always Wondered..


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 :)

Edited by yandoo

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.