Solved

closed tags support

Posted on 2002-06-03
10
142 Views
Last Modified: 2013-11-19
in the new version of HTML it seems that all tags need to be closed.

so, for example, <br> tags should be written as <br />

my question is:

can i use this syntax with all tags in my pages? or will it affect older version browsers?

what is the rule on this?

thanks...
0
Comment
Question by:loyaliser
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 2

Expert Comment

by:Marianne
ID: 7051439
This is XML, not HTML, which requires all tags to be closed. It will not make any harm to your site's appearance in old browsers, but if you will never need to use XML, this would be completely useless things that make code bigger, and that's bad.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7051459
XHTML, leveret. Remember that XHTML 1.0 has replaced HTML 4.0 as the standard. I would encourage you, loyaliser, to look at the benefits of XHTML against HTML.

XHTML provides for a standardised way of writing elements instead of really ugly HTML code with no consistency whatsoever. I must say that size is not everything in a web application. It is maintainability, debuggability and extensibility that makes a site worthwhile. Without these 3 things, it is very difficult for a site to grow in value, content and target audience.
0
 
LVL 23

Accepted Solution

by:
b1xml2 earned 75 total points
ID: 7051470
There is but one small catch with regard to older browsers. Netscape 4.x, bless that horrible thing one called a leading browser, misdiagnoses <br></br> to be two breaks, so <br /> would be the better choice.

Remember that although in XHTML (and XML of course), empty elements can be written as
<input id="hello"></input> OR
<input id="hello" />

We would strongly recommend you use the second example so that you will not be given some nasty surprises from antiquated browsers.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7051476
>>>if you will never need to use XML, this would be completely useless
things that make code bigger, and that's bad.

Since when is forward compatibility bad?  The XHTML 1.01 standard will at some point take over and the end tags will be required.  Why would any one develop a site that does not support XML, when it is obvious that future developers will either have to use it or lose their clients to developrs who can deliver superior in less time for less money using XML.

IMHO.  Any developer who is not coding in the support for XML is creating maintenance problems, and delivering poor value to their clients.

As for current suppport 99% of browsers in use will have no problem with the end tag shortcut.


Cd&
0
 
LVL 1

Author Comment

by:loyaliser
ID: 7051514
TO b1xml2:

well that all sounds like encouraging news... so i don't have to go through all my code and change all my work. XHTML is the way to go... as i started using. just wanted to make sure would not have browser problems.

much cleaner way of doing it...

since i use it, do i need to change this at top of page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">

or leave the same?

TO cobol:

good points. i am of the same mindset... thanks!
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 23

Expert Comment

by:b1xml2
ID: 7051534
leave it be, or use the XHTML DOCTYPE.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
...

</html>
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7051544
0
 
LVL 2

Expert Comment

by:Marianne
ID: 7051644
Heh, I am sometimes really dissapointed by the whole idea of this resource :(

It seems that in order to like it you should post thoughts immediately to get points, poINTS, POINTS!.. While normally complicated questions require a discussion, not just answers as such. The discussion is something I would value much higher than these ready-for-use solutions that appear and disappear here every day.

Sorry, I actually wanted to defend my opinion on the topic, but I guess I'm late.

Good luck.
0
 
LVL 1

Author Comment

by:loyaliser
ID: 7051851
leveret:

u have a valid point, and i agree... i should have waited longer before closing it out.

sorry for the trouble... and thanks for your input.

it is much appreciated in any case, as are the other comments left by users.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7052137
loyaliser,


also, when coding with XHTML, use the validator!

http://validator.w3.org/


makes it much easier to find mistakes.


BRUNO
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now