Print Page | Close Window

Why the slash at the end of the tag?

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=9426
Printed Date: 07 April 2026 at 8:16pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Why the slash at the end of the tag?
Posted By: T313C0mun1s7
Subject: Why the slash at the end of the tag?
Date Posted: 31 January 2004 at 5:17pm

boRg,

I was wondering why for some tags you put a space and an extra slash and on others you don't. Usually it is the br tag. For example <br /> is throughout the code, but I don't see many other tags that have that. I tried removing the extra space and slash in a few instances and it does not seem to make a difference. Just curious. Thanks.




Replies:
Posted By: Semikolon
Date Posted: 31 January 2004 at 6:16pm
its only for tags without ending tag(like img, br, hr, input, etc) because in xHTML all tags should be closed.. and this is the way to close tags without ending tag..


Posted By: Diep-Vriezer
Date Posted: 31 January 2004 at 7:07pm
but <br> is also correct..

-------------
Gone..


Posted By: Semikolon
Date Posted: 31 January 2004 at 7:18pm

in HTML yes, but not in xHTML..

xHTML requires ALL tags to be closed..

but all todays browsers do support HTML 4 so theres no big deal..



Posted By: MadDog
Date Posted: 31 January 2004 at 8:02pm

xHTML is the new HTML.

Everyone should brush up on it. its going to be the new HTML one of these days.



-------------
http://www.iportalx.net" rel="nofollow">


Posted By: dpyers
Date Posted: 31 January 2004 at 8:19pm

Actually, as of HTML 4.0, I believe <br> is not correct. If you try to run the page through the w3c validator, it will fail.

Under the 4.0 spec... ALL tags must be closed - either with separate close tags or with the slash within the tag in cases like <br/> where only the leading part of the tag is used.



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: ljamal
Date Posted: 31 January 2004 at 9:26pm
Originally posted by MadDog MadDog wrote:

xHTML is the new HTML.


Everyone should brush up on it. its going to be the new HTML one of these days.



Nope, browsers will always try to interpret what the HTML is supposed to do in order to render as many pages as possible. This is why IE closed opened tables automatically. As loing as browsers correct mistakes in bad HTML there will never be a "new" HTML.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Semikolon
Date Posted: 01 February 2004 at 5:31am

HTML is supposed to be taken away some times, and xHTML will come.. actually, xHTML is just something between XML and HTML because not all browsers supported XML a couple of years ago..

Originally posted by w3schools.com w3schools.com wrote:

What is XHTML?

  • XHTML stands for EXtensible HyperText Markup Language
  • XHTML is aimed to replace HTML
  • XHTML is almost identical to HTML 4.01
  • XHTML is a stricter and cleaner version of HTML
  • XHTML is HTML defined as an XML application

Originally posted by w3schools.com w3schools.com wrote:

The Most Important Differences:

  • XHTML elements must be properly nested
  • XHTML documents must be well-formed
  • Tag names must be in lowercase
  • All XHTML elements must be closed

 

read more at http://www.w3schools.com - http://www.w3schools.com ..



Posted By: T313C0mun1s7
Date Posted: 02 February 2004 at 10:44am
Thanks all, That helps.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net