TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Death To The Div

60 pointsby kingkool68over 15 years ago

11 comments

byoung2over 15 years ago
You can achieve the same effect now using XHTML namespaces. I defined <question:required>, <question:optional>, <question:subquestion>, <answer:trigger> tags when working on a dynamic survey application I did that would hide or display followup questions based on answers to previous questions.
评论 #799785 未加载
评论 #800403 未加载
fretlessjazzover 15 years ago
Yes! I've always thought that HTML should be more like XML in that arbitrary tags should possess little presentational meaning without an associated stylesheet. Perhaps we'll call this new concoction... HXTML!
评论 #799769 未加载
评论 #799578 未加载
DanielStraightover 15 years ago
I like this thought, but I'm not going to suggest that I can see all the ramifications and which ones we'd all end up hating in 10 years.
评论 #799503 未加载
totalragerover 15 years ago
I'm probably wrong, but isn't this exactly what XSLT does? You define your custom tags and document structure in xml and then apply the visual styles with xsl?
评论 #799541 未加载
arsover 15 years ago
I agree 100%.<p>This would make it a lot easier to edit pages with tricky navigation divs. It would help in many other places too.<p>I always thought that was (on of) the <i>point</i> of css, with display essentially defining what a tag was.
hellotobyover 15 years ago
You can also achieve the same effect using XML and XSLT.<p>[edit]^ beaten by the few minutes it took me to log in! Great minds et al.
评论 #799773 未加载
mahmudover 15 years ago
Lispers had this for ages too; CL-WHO lets me define my own tags and define what to translate them to, divs or spans or whatever.
mcavover 15 years ago
One problem with allowing arbitrary elements is that the browser won't know whether element &#60;foobar&#62; should display as block, inline, etc. CSS styles would need to be specified accordingly whenever custom elements would be used.
评论 #799533 未加载
hellotobyover 15 years ago
Also interesting to note is that FF3 (and quite possibly older versions) interpret and display custom tags which have been styled using CSS.
pedalpeteover 15 years ago
i've been thinking about this considerably lately. Isn't this in many ways what facebook has done with FBML? Just created there own tags, and get a javascript to manipulate it?<p>I understand that it is a dtd, but can't you create any element you want and define it's behaviour in a dtd? I'm still just getting into the research on this.
schammyover 15 years ago
Meh, I don't see the problem with "div soup". The only thing I agree with that's mentioned in the article is that at least you could tell where a specific tag started and ended. But whenever I nest div's more than a few levels deep, I always leave comments in my code for the closing tags to state what specific id/class they are closing. Is that really so hard? No, it's not.<p>Also, as others have mentioned, having made-up tags littered throughout a site's HTML would lead to two problems:<p>- For people learning HTML, you'd have no idea what tags are real and which are make-believe<p>- It would be hard to update the HTML standard in the future without breaking a bunch of sites<p>Both of those are serious problems from my POV.
评论 #799780 未加载
评论 #800294 未加载
评论 #799899 未加载