Optional HTML tags

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
12,816
Loading...
Alert icon
Sign in or sign up now!
Alert icon
There is no Interactive Transcript.

Uploaded by on Jun 22, 2009

Learn how to make your markup leaner by omitting HTML tags to decrease file size and increase the performance of your site. For more information, visit http://code.google.com/speed

Link to this comment:

Share to:

Top Comments

  • What are you talking about? It validates just fine. You've just been taught XHTML and clear don't know HTML.

  • I respect Jens Meiert's skills, but I love the strictness and clarity that XML brings to XHTML, and I wouldn't stop using closing tags. It would in the end make debugging and revisions harder to make... and lessen code beauty. I think people can make pages much faster by just using tabs instead of spaces. Countless times I've seen pages using four spaces just because that's dreamweaver's default. Regex those spaces out for tabs.

see all

All Comments (39)

Sign In or Sign Up now to post a comment!
  • The Webmasters completely left out, that the browser has to compute a SGML tag-soup using HTML, whereas XHTML is interpreted using a XML-Parser, which is guaranteed to be faster.

    Leaving out tags may reduce the file-size, but it does not contribute to the overall processing speed of the browser, which has to guess where the omitted tags should be.

  • Is this advice correct? Surely it is from Google right - mmmm :0. When using STRICT XHTML the pages are parsed faster because of the precise, exact nature implicit in the document definition. Would love to hear peoples comments and understanding of this.

  • Or you can compress the files instead. Like markup is what the problem with website size is... pft.

  • haha that guy looks like imhotep from the mummy

  • @shanedk But an HTML document e.g. w/o an [html] tag is *not* (necessarily) syntactically incorrect. It seems to me that you don't understand the difference between HTML and X(HT)ML syntax.

    "Malformed markup" means e.g. [i]asdf [b]asdf[/i] asdf[/b]. Since the HTML specs precisely specify that some tags can be omitted, there is, in this case, no room for ambiguity in creating the DOM.

    And even if you write all optional tags, your page will still be rendered as tag soup.

  • @e5eb14rde In fact, the article mentions this very issue:

    "Browsers, when faced with malformed markup, must guess the intended meaning of the author. They must infer closing tags where they expect them and then infer opening tags to match other closing-tags. The interpretation can vary markedly from one browser to the next."

  • @shanedk Btw, on your Web site you use the XHTML syntax but send the page with MIME text/html which tells the browser to render it as HTML. You should be grateful that common UAs render *every* text/html page as tag soup since otherwise there would be slahes all over your page; see hixie[dot]ch/advocacy/xhtml for further information. If you really want syntactically strict XML rendering, use the application/xhtml+xml MIME type. You will of course lock out all IE < 9 users.

  • @e5eb14rde Okay: "In Web development, tag soup refers to formatted markup written for a web page which is very much like HTML, but **does not consist of correct HTML syntax and document structure.**"

    So, I WAS right. And if you'll actually read the entry, it goes on to say what kind of things constitute tag soup, and they're EXACTLY the kind of thing advised by Google in this video.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more