CSS 发明者 Håkon Wium Lie 访谈(二)

Bert Bos 如何参与进来的,你们怎么一起工作的?
How did Bert Bos get involved, and how did you work together?

伯特·波斯回顾我的初步建议。他的背景和重点是与我的有点不同,但是当他写了自己的建议,我们很快就意识到,这两项建议可以合并成一个。在这一点上,网络项目被踢出欧洲核子研究中心的出来,W3C 成立。我开始了 W3C 的 INRIA 欧洲分公司和 Bert 立即被录用。大多数 CSS1 被敲定在索菲亚 - 安提波利斯白板在1995年7月伯特仍然是工作的 W3C 在索菲亚 - 安提波利斯。每当我挣扎着困难的技术问题,我想伯特和白板在那里。

Bert Bos reviewed my initial proposal. His background and focus was a bit different from mine, but when he wrote up his own proposal we quickly realized that two proposals could be combined into one. At that point, the web project was being kicked out of CERN and W3C was formed. I was starting up the European branch of W3C at INRIA and Bert was hired immediately. Most of CSS1 was hammered out on a whiteboard in Sophia-Antipolis in July 1995. Bert is still working for W3C in Sophia-Antipolis. Whenever I’m struggling with a difficult technical problem, I wish Bert and the whiteboard were there.

在列出的人谁做的 CSS 可能,我还必须提到托马斯·里尔登和微软的克里斯·威尔逊。托马斯是项目经理的 Internet Explorer(IE)谁早抓上添加样式表来对网站的想法。克里斯·威尔逊是谁添加 CSS 来 IE3 的程序员。 IE3 的实施远没有标准,但是我们必须记住 CSS1 结束之前,它被释放。西蒙·丹尼尔斯(也是微软)写了一些令人印象深刻的演示中 IE3,和他们一起犯了一个主要的软件公司支持的新兴标准。
When listing people who made CSS possible, I must also mention Thomas Reardon and Chris Wilson of Microsoft. Thomas was the program manager for Internet Explorer (IE) who early caught onto the idea of adding style sheets to the web. Chris Wilson was the programmer who added CSS to IE3. IE3’s implementation was far from the standard, but one must remember that it was released before CSS1 was finished. Simon Daniels (also of Microsoft) wrote some impressive demos in IE3, and together they committed a major software company to support an emerging standard.

是否有竞争的其他草案,为何你的较优?
Were there any competing proposals? Why was yours better?

有要使用的十几个建议样式表语言。然而,并不是所有的人都适合的,因为在网络的特性。例如,浏览器使用渐进式渲染文件显示,他们必须处理,其中样式表无法访问的情况。有一个广泛的网络设备在那里,你不能写一个样式表的每一个。因此,样式表语言表达必须是可扩展性和响应性设计。这是研究的一个迷人的地方,我已经写了博士论文,其中比较所采取的各种样式表建议的方法。
There were a dozen or so proposals for style sheets languages to be used. However, not all of them were suitable due to the characteristics of the web. For example, browsers use progressive rendering to display documents, and they must handle situations where style sheets are not accessible. There’s a wide range of web devices out there and you can’t write a style sheet for each one. So, style sheet languages must express designs that are scalable and responsive. It’s a fascinating area of study and I’ve written a PhD Thesis, which compares the approach taken by the various style sheet proposals.

当然,我有偏见你问题的第二部分。但我相信,CSS 有几个显着的特点,这使得它特别适合于网络应用:级联,伪类和伪元素,向前兼容的解析规则,针对不同的媒体类型,十分注重选择,以及令人称奇的em单位的支持。

Naturally, I’m biased in the second part of your question. But I believe CSS has several notable features which makes it especially suitable for web use: cascading, pseudo-classes and pseudo-elements, forward-compatible parsing rules, support for different media types, strong emphasis on selectors, and the amazing em unit.

敢问,你和 Bert 出过最大的篓子是什么?
What’s the biggest mistake you (and Bert) made?

在我博士论文的主题,就是研究 CSS 的问题。有相当于问题是其自身的问题。但 CSS1 最大的问题不是设计问题(如果你问我设计好不好,我觉得还是不错的~哈哈),而是最初版本的实现,很糟糕。 Jeffrey Zeldman 这样说:
I devote a chapter in my PhD thesis to problems in CSS. There are some, even self-inflicted ones. But the biggest problem CSS1 experienced was not in its design (which is pretty good, if you ask me), but rather in the initial implementations. Jeffrey Zeldman described the situation:

If Netscape 3 ignored CSS rules applied to the element and added random amounts of whitespace to every structural element on your page, and if IE4 got right but bungled padding, what kind of CSS was safe to write? Some developers chose not to write CSS at all. Others wrote one style sheet to compensate for IE4’s flaws and a different style sheet to compensate for the blunders of Netscape 4.

这当然是微软和网景的责任(译注:属于实现的层面,不关我事哦),但是我、Bert、W3C在制定 CSS1 规范的时候,原本是可以通过测试套件来检测出许多问题的。话说第一款测试工具还是 1998年,为 Todd Fahrner 于 1998 年十月所推出,叫做 Acid。这是个神器,前所未有,让开发者看到结果到底是不是通过,而且还是可视化的。刚开始的时候,没有一款浏览器可以通过。及后,CSS 社区强力发劲,推动了 CSS 发展。WaSP 对标准的坚定支持亦是关键的一步。同时 Opera 在正确编写 CSS 实现方面也扮演了其重要的角色。当我知道 Oprea 对 CSS 实现的态度是如何坚定的时候,便促使我投奔向 Oprea 公司,而非什么微软或网景。
Microsoft and Netscape both deserve some blame, but we — me, Bert, W3C — could have avoided many problems by producing a test suite along with the CSS1 specification. The first real CSS test appeared in October 1998 when Todd Fahrner published his Acid test. The test was creative, visual, and developers could immediately see whether they passed the test or not. In the beginning, no browsers passed. But then, with a strong push from the CSS community, things started to improve. The WaSP played a key role in assuring support for standards. The Opera browser also played a role by showing it was actually possible to implement CSS correctly. When I realized how solid Opera’s CSS implementation was — much better than Microsoft’s or Netscape’s — I joined Opera.

在我加入之前,Opera 曾标榜其体积极小,一张软盘就搞定了(1.44MB),这是当其时的一个亮点。不过~哈哈,加入 CSS 之后,越来越大了,一张软盘哪搞得定呀~
One of Opera’s claims to fame before I joined was that the browser would fit on a floppy disk (which is 1.44 MB). “Fits on a floppy” was a great slogan in those days. When CSS was added, a few more bytes were needed and Opera would no longer fit. “Almost fits on a floppy” doesn’t quite have the same ring to it.

Acid 的后续有 Acid2 和 Acid3,但都是同一条准则,即对 Web 页面进行多项严格的测试。后来,Bill Gates 看到问题所在,也按捺不住了,发表一封公开信。该公开信得到了 Acid2 开发团队的响应。总之,这使得 IE7 开始兼容标准,当然仍是很多问题。不过公道地讲,其他浏览器也有问题,通通都给 Acid2 暴露出来了。微软对 IE7 在 Acid2 的表现糟糕,干脆不理——到 IE8 的时候却跟上来了,完全通过!同期的其他浏览器也没啥问题了。
The original Acid test inspired Acid2 and Acid3, which use the same formula: a visual and demanding web page which tests a wide range of features. The development of Acid2 was triggered by an open letter from Bill Gates, where he praised interoperability. Making IE7 follow the CSS standards seemed like a natural follow-up item, and Microsoft was challenged by Acid2. In fairness, other browsers also had issues, and Acid2 exposed bugs in all of them. Microsoft ignored Acid2 in IE7, but — magic sometimes happens — IE8 supported it perfectly. As do all current browsers.

你为什么决定包装盒上的模式,即的margin,padding,边框都加入到申报的宽度,而不是IE5箱大小:边界盒模型?
Why did you decide on the box model whereby margin, padding, border are added to declared width rather than the IE5 box-sizing: border-box model?

有良好的用例两款车型,我相信。如果你想要的图像伸出来填充整个内容中,原来的 CSS 框模型是一个使用。但是,如果它是填充和边框并不一定区域之外的延伸是重要的,在IE5的模型更好。我个人认为还有更多的用例的 CSS 框模型,但有些人说我尊重看得起并非如此。冲突已经通过加入其中所有的浏览器都支持的盒集束性的正常解析。
There are good use cases for both models, I believe. If you want want an image to stretch out to fill the whole content box, the original CSS box model is the one to use. However, if it’s important that padding and borders do not extend outside a certain area, the IE5 model is better. Personally I think there are more use cases for the CSS box model, but some people that I respect highly think otherwise. The conflict has been gracefully resolved by the addition of the box-sizing property which all browsers now support.

我本人不太喜欢绝对布局。是我理解有问题吗?它是怎么来到规范中的?
I’ve always disliked absolute positioning. Am I wrong? How did it come about in the spec?

你的问题令我回忆 1996 年时候大家争得面红耳赤。简单说,就是那时候微软提出了一份草案,那时候还不叫绝对布局,说是 CSS Regions:里面有绝对布局和 Z-Ordering。仅限 W3C 会员的讨论,我猜。这是刚组建不久的 CSS 工作组。对此,里面几个成员均有所保留。于是我和 Bert 撰写了一份简单的反对草案,在这个草案中移除掉定位属性 position property(取而代之的是 display 属性)。最后,微软也移除了他们在草案中已经实现了的功能。作为妥协,加入了 right /bottom 属性(相对于 left/top属性),还加入了 position:fixed。这都成为 CSS2 的一部分。
Your question takes me back to some heated debates in 1996. The short story is that Microsoft proposed absolute positioning in a draft called CSS Regions: Absolute Positioning and Z-Ordering (discussions took place on W3C member-only lists, I’m afraid; the closest public document is WD-positioning). Several members of the newly formed CSS Working group had reservations, and Bert and I wrote up a simplified counter-proposal. Our proposal got rid of the position property (display was used instead) and only described relative positioning (which would give us time to think through absolute positioning). Microsoft, however, had already implemented their proposal and were reluctant to remove functionality. In the end, the only material changes were to add the right and bottom properties (to balance left and top), and to add position: fixed. This became part of CSS2.

我和你身同感受,不怎么感冒绝对布局。不过话虽这么说,绝对布局找到了它自己合适发挥的地方,我不时用它来实现的某些东西,不用的话将会很困难,否则就要进行硬编码。
Like you, I have never become comfortable with absolute positioning. That being said, absolute positioning has found its place on the web and I use it from time to time to achieve things that would otherwise be hard, if not impossible, to encode.

我有听人说过,不要采用浮动布局,就像他们“不想”在文字围绕图片中使用浮动。不过,如果可行,这种想法重要吗?
I’ve heard people say that you shouldn’t use floats for layout, as they “weren’t intended” for that — they were just to wrap text around images. Does the intention matter, if they work?

文字围绕图片是个简单的活。这种情况肯定使用浮动布局。另外我希望在屏幕分页的时候也把浮动派上用场。因为你可以轻易地把页码标记作为浮动元素标记在屏幕的任意一个地方,如左上或左下。
Having text wrap around images is one of the basic layout techniques. For sure, floats should be used for layout. One area I’d like for CSS to progress into is paginated onscreen presentations. When you paginate content, floats become even more useful because you can float elements to the top and bottom of the screen.

时间: 2024-10-08 22:58:12

CSS 发明者 Håkon Wium Lie 访谈(二)的相关文章

CSS 发明者 Håkon Wium Lie 访谈(一)

导语:本人利用业余时间翻译.受本人水平所限,当中错谬不少,还望大家斧正! 原文地址:https://dev.opera.com/articles/css-twenty-years-hakon/ --------------------------------------------------------------------------------------------------------------------- 二十年前的今日,Opera 的 CTO Håkon Wium Lie

CSS 发明者 Håkon Wium Lie 访谈(三)

如果你手上有魔棒,你会发出什么的魔咒,让 CSS 按照你的想法走?另外,还有什么你想搞进来的,而且又会受到大家欢迎的?If you could wave a magic wand, which bit of current CSS would you banish from the world, and what would you magically add and implement everywhere? 首先,我会把浏览器专属特定的代码干掉,像 <!--[if lt IE 7 ]> 诸

网页代码中H型标签与CSS调用H型标签探讨!

中介交易 http://www.aliyun.com/zixun/aggregation/6858.html">SEO诊断 淘宝客 云主机 技术大厅 大家好我是上海SEO(SWJ) 今天与大家一起探讨 在网页代码中 使用DIV+CSS布局中的CSS调用H型标签 与网页原本的H型代码 之间的关系 是否与SEO过度优化有联系,对搜索引擎抓取之间的联系! 我们就拿上海SEO顶部的介绍代码来分析下:<div id="info"><h1>上海SEO(seo

mfc-关于afxcomctl32.h错误,求助

问题描述 关于afxcomctl32.h错误,求助 一共有106个相关错误: 错误 1 error C2504: "CNoTrackObject": 未定义基类 c:program files (x86)microsoft visual studio 10.0vcatlmfcincludeafxcomctl32.h 174 错误 2 error C2146: 语法错误: 缺少";"(在标识符"m_strModuleName"的前面) c:prog

不要再在JavaScript中写 CSS了

本文作者是 react-css-modules 和 babel-plugin-react-css-modules 的作者.并不是对 CSS in JavaScript: The future of component-based styling,或是使用样式组件的反对,而是一种补充,web 开发者要了解自己的需求,明白自己使用 styled-components 的真正原因. 9 个谎言 CSS 不应随意放置.许多项目选择将样式写在 JavaScript 中的理由不对.本文列出了常见的误解,以及

DHTML【7】--CSS

    本节将要介绍CSS的选择器,CSS有三种常用的选择器,还有三种扩展选择器,说到选择器,那么选择器是做什么用的呢?       上一节我们介绍CSS常用属性的时候,我们都是通过在标签内定义Style属性来介绍的,但是如果Style中的属性有很多,并且我们还要把相同类型的标签用同一个CSS样式来美化,我们总不能Copy代码吧,首先页面太乱,再者代码量大,在大型的网站开发中会影响执行效率,最后自己操作起来也很麻烦,遇到这个问题,我们改怎么解决呢?       这就是选择器要做的事情,我们可以先

移动端前端笔记 — 遇到的常见JS与CSS问题及解决方法

笔者接触移动前端快一年了,特将平时的一些笔记整理出来,希望能够给需要的人一些小小的帮助.同时也由于笔者的水平有限,虽说都是笔者遇到过使用过的,但文中可能也会出现一些问题或不严谨的地方,望各位指出,不胜感激! 一. css部分 body如果设置height:100%;overflow:hidden是依然可以滑动的,如果需禁止,要再加一层div设置 height:100%加overflow:hidden(html,body加height:100%) ,这样元素超出body的高度也不能滑动了. 或者同

CSS体系格局参考图

css|参考|体系  很早就想为CSS做个图,可惜一没时间二挺复杂,今天写了操作性之后,也懒得做活了,就打开fireworks开始作图啦!下面是关于整个CSS的: 说明:现阶段大家使用的CSS,分两中模式:Quirks mode和Strict mode,Quirks mode自然是浏览器生产商自己的模式,其中含有对CSS的解析,私有CSS.标准模式(strict mode),当然有W3C制定,现在浏览器普遍支持的和我们使用的是CSS21/ href="http://www.w3.org/TR/C

深入了解CSS的继承性及其应用

css|继承 所谓CSS的继承是指被包在内部的标签将拥有外部标签的样式性质.继承特性最典型的应用通常发挥在整个网页的样式预设,需要指定为其它样式的部份设定在个别元素里即可.这项特性可以给网页设计者提供更理想的发挥空间.但同时继承也有很多规则,应用的时候容易让人迷惑,donger今天就专门和大家聊聊这方面的应用. 正文 CSS是层叠样式表(Cascading Style Sheets)的简称,它的规范代表了互联网历史上一个独特的发展阶段.现在对于从事网页制作的朋友来说,很少没有听说过CSS了吧,因