Slashdot Mirror


Finally We Get New Elements In HTML 5

An anonymous reader writes "Pure HTML enhancements hardly grew at all in the last eight years. Forward motion basically stopped in 1999 with HTML 4. Now the future looks bright. Recently, HTML has come back to life with HTML 5. Tons of new elements will be available for structure (article, nav, section, etc.), block semantic elements (aside, figure, dialog), and several other functions."

13 of 378 comments (clear)

  1. Do we need "MORE"? by Puls4r · · Score: 3, Insightful

    When existing browsers constantly break standards, do we need "more"?

    I mean, seriously - I can do anything I need to do with a web page with the tools we have right now. Adding more options just results in more bloat, more exceptions and errors, and more difficult compatibility. It means new versions of other software to keep up, and new ways to exploit.

    When do we need well enough alone?

    1. Re:Do we need "MORE"? by hobo+sapiens · · Score: 3, Insightful

      Agreed. Not to be overlooked is the javascript code that can be eliminated.

      Want a menu? Gotta write javascript. Want to restrict the length of a textarea? Gotta write a script. Want to make that select box behave like a real select box in a desktop app (where you can type to find a value)? Gotta write javascript.

      New tags that accomplish what should be standard behavior would make most websites much leaner and therefore much more maintainable. TFA did not indicate that select or textarea elements are going to be spruced up, though.

      --
      blah blah blah
  2. Re:Excellent! by LighterShadeOfBlack · · Score: 5, Insightful

    The idea is that an "article" is semantically different from other text. It's all well and good styling your text with <span class="header">, <span class="emphasis">, <span class="cite"> etc. to make your text look good on your webpage but that's no good for a computer that's trying to interpret your text in a meaningful way. By using semantic tags it should mean computers can do more in terms of searching and indexing the web to allow all of us to find what we want faster.

    --
    Spelling mistakes, grammatical errors, and stupid comments are intentional.
  3. Re:Excellent! by peter_gzowski · · Score: 4, Insightful
    Well, I would have preferred HTML 5 to add things that I could use (perhaps an include or multi-file-select), but I think the answer to your question is: readability. The div's can nest up to the point that you forget what the is paired with. I end up writing XHTML like this:

    <div id="foo">
        <div id="bar">
            <div id="baz">
    ... lots of stuff ...
            </div> <!-- End of "baz" -->
        </div> <!-- End of "bar" -->
    </div> <!-- End of "foo" -->
    If what I'm using to id my div's is actually a common semantic, then maybe it should have its own tag.
    --
    "Now gluttony and exploitation serves eight!" - TV's Frank
  4. Re:Excellent! by Anonymous Coward · · Score: 3, Insightful

    And how is <div class="article"> not machine parsable?

    The problem with semantic anything is that it requires an agreement as to what marks what. If you want to be able to mark articles right now, you can do it with HTML 4, and agreeing that anything that is semantically an article is marked with the "article" class. In fact, it's already been done: they're called microformats.

    Changing <div class="article"> to <article> accomplishes nothing, other than reducing the amount of text that needs to be typed, with the side-effect of requiring people to upgrade their browser.

  5. Re:Excellent! by telbij · · Score: 3, Insightful

    The difference is that <article> is an element defined by HTML 5 with a documented meaning. <div class="article"> is a generic element with an arbitrary attribute defined by the document author.

    I would go so far as to say <div class="article"> is semantically useless. Sure a human or a clever heuristic engine can infer some meaning from that, but it's too imprecise to be of much use on a large scale aggregation or data mining.

    Frankly I'm not a huge believer in HTML semantics anyway. Standards snobs will endlessly critique the use of a <ul> vs an <ol> on the merit of "semantics" which in practice makes no appreciable difference. It's like they've never seen tag soup and the real reason for using CSS.

    That said, a lot of these new tags are well overdue. If you consider HTML hasn't changed in 10 years and at that time we barely knew how the web would be used. HTML is pretty good for traditional text, but it has virtually nothing for the web as we know it. For instance, structural markup defining navigation has an actual tangible benefit. Browsers (especially screen readers) could make wonderful use of that information.

  6. XHTML/HTML divergence by Animats · · Score: 5, Insightful

    What's wierd about this is that it goes off in a completely different direction than XHTML. Tags don't have to be properly closed, no namespaces, etc.

    A big advantage of XHTML was that the conversion to a parse tree was unambiguous. Why give up that at this late date? All this ambiguity breaks visual HTML editors. Dreamweaver 3 was closer to "what you see is what you get" than today's Dreamweaver 8.

    Consider, for example, a lone </br> that doesn't terminate anything. Most browsers today treat that as a valid break, not an orphan tag to be ignored. XHTML was supposed to end that kind of nonsense.

    The problem with XHTML has been that CSS layout was badly designed. "float" and "clear" just aren't a good set of layout primitives. Cell-based layout (yes, "tables") was a fundamentally more powerful concept. But it's not XHTML that's the problem. It's that the positioning mechanisms for "div" sections are terrible.

    Layout is really a 2D constraint problem. Internally, you have constraints like "boxes can't overlap", which turns into constraints like "upper left corner of box B must be below lower left corner of box A", or "right edge of box A and left edge of box B must have same X coordinate". Browsers really ought to do layout that way. Table layout engines come close to doing that. At least with tables you never get text on top of other text. "div" doesn't have comparable power. "float" and "clear" represent a one-dimensional model of layout, and that's just not good enough.

  7. Re:Excellent! by patman600 · · Score: 5, Insightful
    Because there is no standard. You could have

    <div class="article"> or <div class="main texty stuff">
    . If there is a standard, then things like screen readers will easily be able to divide the article text from a navigation section. Imagine telling your computer to read you the article, and not having to wait for it to work it's way past the navigation bar. Or skipping back to the nav bar if you are tired of the article half way through.
  8. Re:Excellent! by rhartness · · Score: 5, Insightful

    No, they shouldn't because it would be a waste of time. No web designer in their right mind would mark any thing as an object because, sure enough, as soon as it's implemented in an HTML spec, some one out there will right a plug-in to hide those elements.

    Web developers want their ads to be seen. They aren't going to make it easy for those ads to be blocked.

  9. Re:Excellent! by Bogtha · · Score: 5, Insightful

    Microformats are a good solution where a problem is domain-specific. HTML is extensible with mechanisms like the class attribute so that HTML doesn't have to include lots of element types that aren't useful to most people.

    But when something is applicable to a wide variety of situations, the right place for it is in the HTML specification, not as an ad-hoc extension. Otherwise, you could just make the argument for every element type under the sun being replaced with <div class="..."> or <span class="..."> . At that point, you're just using the class attribute as a bodge to avoid new element types, not because it's a good idea.

    Yeah, sure, it's nice that browsers don't have to be updated for microformats to work. But that doesn't mean it's good design to try to stuff everything under the sun into the class attribute. Sometimes the right place for something is in the HTML specification.

    --
    Bogtha Bogtha Bogtha
  10. Re:Excellent! by LighterShadeOfBlack · · Score: 3, Insightful

    Well at this point it's important to note one of the things that HTML 5 is not: XML. HTML 5 is plain-old HTML, meaning it's syntactically forgiving (ie. case-insensitive elements and attributes, closing tags optional). That might not be important for you or me or most other Slashdot users but for the vast majority of people that kind of forgiving behaviour is very important. Can you imagine what Myspace would look like if everyone were required to use Strict XHTML or XML+XSL on their pages? Errors as far as the eye can see I'd wager (whether that would actually be better than Comic Sans and animated backgrounds is another matter).

    HTML 5 is something you can pick up along the way. It's very much accessible to the common man with just a smidgen of computer knowledge. Raw XML is learnable too, if somewhat inconvenient for beginners in its strictness when hand-editing. Styling it on the other hand is not something for the layman. I don't think anyone who's worked with XSLT and XPath could honestly disagree that they are progammers' tools and shouldn't be considered for the casual web author.

    One other benefit of HTML 5 over XML is that it can fail gracefully on old and unsupportive browsers. With HTML 5 the worst thing you're likely to get is HTML 4.01 support with some text that doesn't style appropriately. With XML you're stuck.

    --
    Spelling mistakes, grammatical errors, and stupid comments are intentional.
  11. Re:Excellent! by Asmor · · Score: 3, Insightful

    Actually, they need to put in an <ad> tag. Amusing, but actually scary when you think about it... The only way such a tag would actually be implemented by people with advertising is if there were DRM-like restrictions on browsers forcing ads to be shown. I'm sure it wouldn't be hard to get IE to implement such restrictions, and honestly I wouldn't be surprised if they found a way to force Firefox to implement them too. So i say nay to <ad>.
  12. Re:Excellent! by Xtravar · · Score: 5, Insightful

    And so how do advertising campaigns fit into this wondrous new paradigm where web developers supposedly have the competence and ethics to only put an article in an article tag?

    The fact of the matter is, nobody will use the damn tags correctly and then a screen reader will read a paragraph on Viagra before actually getting to content.

    More bastardization of already bastardized HTML... and even more new ways to fuck things up.

    --
    Buckle your ROFL belt, we're in for some LOLs.