| Author |
Topic Search Topic Options
|
T313C0mun1s7
Newbie
Joined: 03 September 2003
Location: United States
Status: Offline
Points: 16
|
Post Options
Thanks(0)
Quote Reply
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
|
 |
Semikolon
Senior Member
Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
|
Post Options
Thanks(0)
Quote Reply
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..
|
 |
Diep-Vriezer
Senior Member
Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 January 2004 at 7:07pm |
|
but <br> is also correct..
|
|
Gone..
|
 |
Semikolon
Senior Member
Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
|
Post Options
Thanks(0)
Quote Reply
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..
|
 |
MadDog
Mod Builder Group
Joined: 01 January 2002
Status: Offline
Points: 3008
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
dpyers
Senior Member
Joined: 12 May 2003
Status: Offline
Points: 3937
|
Post Options
Thanks(0)
Quote Reply
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.
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 January 2004 at 9:26pm |
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.
|
|
|
 |
Semikolon
Senior Member
Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
|
Post Options
Thanks(0)
Quote Reply
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..
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
|
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..
|
 |