TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Death To The Div

60 点作者 kingkool68超过 15 年前

11 条评论

byoung2超过 15 年前
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 未加载
fretlessjazz超过 15 年前
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 未加载
DanielStraight超过 15 年前
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 未加载
totalrager超过 15 年前
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 未加载
ars超过 15 年前
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.
hellotoby超过 15 年前
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 未加载
mahmud超过 15 年前
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.
mcav超过 15 年前
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 未加载
hellotoby超过 15 年前
Also interesting to note is that FF3 (and quite possibly older versions) interpret and display custom tags which have been styled using CSS.
pedalpete超过 15 年前
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.
schammy超过 15 年前
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 未加载