Jump to content

Html 4.01 Standard


atar.yosef

Recommended Posts

Hello to all!!! :)As known to all, in the new HTML 4.01 standard, all the tags must be closed properly as the W3Schools wrote on their HTML Tutorial.My question is if tag like the <br> tag, also must be properly close with a </br> tag?Also I would like to ask if I "close" tag at its opening tag like <br /> or <link /> it also will be accepted by the HTML 4.01 standard?I will be happy to hear the members professional opinions!! :)

Link to comment
Share on other sites

I was under the impression that XHTML required the self-closing of all non-paired tags. In the case of <br> you would write it as <br/>In fact, I think you would get an error in the validator is you had <br/> with an HTML based DTD.

Link to comment
Share on other sites

Once upon a time, certain tags that introduced content did not have to be closed. This included <p> <li> and <td> tags, and maybe a few others. As I wrote, the thought was that these tags intoduced content. The idea that the tag created a page element, and the content that followed was part of the element, had not complete developed yet. It helps to remember that early HTML (ca 1992) was presentational in nature. A tag said: "Here's what the following content should look like."Today we think of tags as creating a page element (or DOM object), which may or may not have built-in presentational features. Some elements have content. Some do not.Here's the basic rule: if an element holds content (text or other page elements), it requires an opening tag and a closing tag. So in 2009, <p> and <li> elements require closing tags, because they are meant to hold content. It does not matter if the appearance of a new <p> or <li> tag implies that the previous <p> or <li> has closed. We must close it explicitly, because closing it is logical.If an element does not hold content, then the element is defined by a single tag. That tag is said to be "self-closing," and in HTML (unlike XHTML) it requires no special closing symbols. Self-closing elements like this include most form inputs, and the <br> and <hr> elements.(It may be useful to think about the difference between a form element's value and an element's content. It is true that the value property of a form element determines what the user sees, and for this reason you might think of it as content. The difference is that the value is the data that gets submitted to the server defined by the form's action attribute. Also, the value of a form element depends on the user's choice, not the page designer's. So value and content really are different things, even if they don't always look like it.)

Link to comment
Share on other sites

In HTML 4.01:

  • A lot of tags do not need to be closed.
  • A lot of tags can be omitted, including <head> and <body>.
  • Tags aren't case sensitive
  • Self-closing tags like <img /> <param /> and <link /> are not correct if you use slashes to close it.

Link to comment
Share on other sites

  • 2 weeks later...
In HTML 4.01:
  • A lot of tags do not need to be closed.
  • A lot of tags can be omitted, including <head> and <body>.
  • Tags aren't case sensitive
  • Self-closing tags like <img /> <param /> and <link /> are not correct if you use slashes to close it.

Hello there!!!Sorry, but I think you are mistake. The W3schools themself wrote at their HTML tutorial that at XHTML all of the tags must to be closed and must to be wroten at lower-case letters.Please refer to to this page under the section "Prepare Yourself for XHTML".
Link to comment
Share on other sites

The W3Schools website is not affiliated with the W3C, and cannot speak for the consortium. On the mentioned page, they recommend that you write HTML in a certain way that is similar to XML, but just by doing that they can't change the mechanics of SGML.Indeed, XML tags must be closed, one way or the other, and tag names written in lowercase. Not so with SGML, however.For example, try validating this: http://www.aspektas.com/blog/the-weirdness-of-sgml/.

Link to comment
Share on other sites

Once upon a time, certain tags that introduced content did not have to be closed. This included <p> <li> and <td> tags, and maybe a few others. As I wrote, the thought was that these tags intoduced content. The idea that the tag created a page element, and the content that followed was part of the element, had not complete developed yet. It helps to remember that early HTML (ca 1992) was presentational in nature. A tag said: "Here's what the following content should look like."Today we think of tags as creating a page element (or DOM object), which may or may not have built-in presentational features. Some elements have content. Some do not.Here's the basic rule: if an element holds content (text or other page elements), it requires an opening tag and a closing tag. So in 2009, <p> and <li> elements require closing tags, because they are meant to hold content. It does not matter if the appearance of a new <p> or <li> tag implies that the previous <p> or <li> has closed. We must close it explicitly, because closing it is logical.If an element does not hold content, then the element is defined by a single tag. That tag is said to be "self-closing," and in HTML (unlike XHTML) it requires no special closing symbols. Self-closing elements like this include most form inputs, and the <br> and <hr> elements.(It may be useful to think about the difference between a form element's value and an element's content. It is true that the value property of a form element determines what the user sees, and for this reason you might think of it as content. The difference is that the value is the data that gets submitted to the server defined by the form's action attribute. Also, the value of a form element depends on the user's choice, not the page designer's. So value and content really are different things, even if they don't always look like it.)
Deirdre's Dad, thanks you very much about your detailed clear and kind answer!!! :) :)Every time I am amaing anew from you!!! :) Have a nice day!!
Link to comment
Share on other sites

The W3Schools website is not affiliated with the W3C, and cannot speak for the consortium. On the mentioned page, they recommend that you write HTML in a certain way that is similar to XML, but just by doing that they can't change the mechanics of SGML.Indeed, XML tags must be closed, one way or the other, and tag names written in lowercase. Not so with SGML, however.For example, try validating this: http://www.aspektas.com/blog/the-weirdness-of-sgml/.
Hello there!!!Sorry about my ignorance, but what is this exactly SGML? I know (recognize) only HTML, XHTML etc, is there a W3schools tutorial about the SGML? :)
Link to comment
Share on other sites

SGML is the parent language that HTML is based on, just like XML is the parent language XHTML is based on. Syntax rules are the same for HTML as they are for all SGML-based languages.

Link to comment
Share on other sites

Hello there!!!Sorry about my ignorance, but what is this exactly SGML? I know (recognize) only HTML, XHTML etc, is there a W3schools tutorial about the SGML? :)
CAUTION: This may be a lot of information to swallow at once. Take breaks between paragraphs if you don't understand something.SGML and XML - both of which you saw mentioned in this topic a few times - are sets of rules for defining markup languages. Different other languages are said to be "based on" them. In particular, HTML is based on SGML, and XHTML is based on XML. Because they are "based on" them, they follow whatever rules are defined in those standards.What SGML defines is that (for example) tag names are not case sensetive, that empty ("self-closing") elements don't need a special character to be closed, that opening tags start with "<", and may OPTIONALLY end with ">" if there are not attributes, etc. It also defines a few features such as empty tags ("<>") and others. One particular weakness of SGML is that it doesn't define error handling.XML is a subset of SGML that takes the basics of SGML, and removes some of the more nifty features, in order to make writing parsers* for it easier. Again to make implementations easier to write, XML places a few requirements over the existing SGML features, such as requiring tag names to be case sensetive, requiring empty elements to use "/" before the ending ">" (which is also now always required), etc. XML also defines that parsers must stop processing when a rule is broken.W3Schools doesn't have an SGML tutotial, because there are barely any parsers for it, and there are barely few languages using it. HTML is by far the only popular language left that is based on SGML. The sad thing though is that browsers don't really follow SGML with HTML. They have their own custom "HTML parsers" that only use the subset of SGML that is required for the larger kind of HTML documents on the web.XML on the other hand, thanks to its error handling definition, is far more widely implemented, has much more languages based on it, etc. This is why W3Schools has a tutorial on it - so that you can define your own markup language, based on it, and know what are the actual rules you must follow.*A paser is a program that reads a file or text and produces something out of it. In the case of SGML and XML, this is to read the markup, and create the so called "DOM tree" out of it. It is from this tree that browsers render the pages you see. The HTML and XHTML specifications actually define just that - how should a browser (a kind of a "user agent") process the DOM tree to render the page. It also defined what special actions must it perform at some of them. E.g. they define that the "user agent" must replace the "img" element with an actual image with the dimensions specified in the "height" and "width" attributes, or the image's dimensions if those attributes are omitted.
Link to comment
Share on other sites

Hello there!!!Sorry, but I think you are mistake. The W3schools themself wrote at their HTML tutorial that at XHTML all of the tags must to be closed and must to be wroten at lower-case letters.Please refer to to this page under the section "Prepare Yourself for XHTML".
I notice a lot of other people have answered you already.Just keep in mind that HTML and XHTML are two different languages with different rule sets. All the features I mentioned apply to HTML.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...