Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Why the slash at the end of the tag?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Why the slash at the end of the tag?

 Post Reply Post Reply Page  12>
Author
T313C0mun1s7 View Drop Down
Newbie
Newbie


Joined: 03 September 2003
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote T313C0mun1s7 Quote  Post ReplyReply Direct Link To This Post Topic: Why the slash at the end of the tag?
    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.



Edited by T313C0mun1s7
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 31 January 2004 at 7:07pm
but <br> is also correct..
Gone..
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post 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..

Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post 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..

Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.