如果你手上有魔棒,你会发出什么的魔咒,让 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 ]> 诸如此类的。CSS 里面没有这样浏览器特定的代码——尽管不提供,但是也不要用“注释”这样子的风格呈现,而且这样子是“反” Web 标准的。
I’d banish browser-version-specific code like: <!--[if lt IE 7 ]> . While technically not expressed in CSS, these kinds of “comments” should not be necessary and they lower the standards of the web.

你的第二个问题,我觉得是个有意思的问题,啥东西突然叫好又叫座?2006 年,我想是非 Web fonts 莫属。2007 年,我会说 <video> 元素(<video> 元素冒进来 HTML 已经一段时间了)。而时至今日,各家浏览器都支持好这些特性了。
The second part of your question is even more interesting: what parts of CSS should be magically implemented everywhere? In 2006, I would have said web fonts. In 2007, I would have said the element (straying into HTML-land for a while). Both of these are now implemented in all browsers.

2011 年,我看到 app 用户是以 页 的方式,而不是以 滚动 的方式浏览内容的。于是我提倡 Web 内容页面化。什么是页面化?就是把很长的一段内容自动划分到不同的页面,用户通过手势看完一页又翻到下一页,或者按 PageUp/PageDown——这不就是浏览器里的电子书嘛~不过我希望可以更简单些。这就是我想的魔咒啦~哈哈。
In 2011, seeing that many apps used pages (and not scrollbars) to create compelling presentations, I started advocating for web pages to become real pages. The idea is that the style sheet would trigger paged mode so that content is split into pages. Users would navigate from one page to the next with gestures, or perhaps with PageUp and PageDown. I want it to be possible, even easy, to create ebook-readers in browsers. For this to happen, a bit of magic would be helpful. Could you sprinkle some fairy dust on the pillows of all browser vendors, please?

CSS 不仅仅为浏览器而设的。2005 年的时候,我和 Bert 合著了一本关于 CSS 的书。第三版的时候,我们就想,看看能不能在写书的过程中,就用 CSS 来编写(译注:定义格式之类的)。后来,神器 Prince 出现了! Michael Day 和墨尔本的伙伴发明了这种好东西,可以把 PDF 里文档采用 HTML/CSS 来定义,简直是神器!然后发送到打印机打印,毫无问题!于此期间,我发现了 Prince 的若干 bug。为此,我还参与 Prince 的开发。Prince 已经导出了上百本书籍了。我相信,未来仍然有相当的纸质书,不过稍有点不同的是,纸质书被印刷之前,它们采用 HTML/CSS 定义格式。
But CSS is not just for browsers. Bert and I wrote a book on CSS and in 2005, for the third edition, we wanted to use CSS itself for formatting. The browsers were not up to the job, but then Prince came along. Michael Day and his colleagues in Melbourne made a terrific product which was able to create a beautiful PDF document from HTML and CSS which we could send to the printer. In order to them to fix my favorite bugs, I joined the board of directors. Prince has since been used to format hundreds of books. We will still have some paper books in the future, I believe. And they will be made from HTML and CSS.

Why do we still not have a method of laying out pages in CSS that doesn’t require a Doctorate in Rocket Surgery? (I’m looking at you, Flexbox…)

布局是个复杂的话题,而且鉴于多种多样的显示设备,Web 之上的布局更显复杂。针对内容,CSS 有几种不同的布局机制:绝对布局,浮动,多列布局,Table 布局等。它们之间的嵌套更是复杂,但我不认为 doctorate 是需要的。我必须承认
Layout is complex, and layout on the web is even more complex due to pages being displayed on so many different devices. CSS has several mechanisms for laying out content, including absolutely positioned elements, floats, multi-column layout, and CSS tables. The interaction between them can be complex, but I don’t think any doctorate is needed. I must admit to not having used Flexbox much, though.

你对诸如 SASS 和 LESS 这类预处理器的看法是如何?CSS 应该从中汲取些什么优点?What’s your opinion on pre-processors like SASS and LESS? Does CSS have anything to learn from them?

是的,预处理器是好东西。我们应该把预处理器好的东西进行“拿来主义”来改造 CSS 本身。我个人最喜欢内嵌选择器,呃,还有单行注释吧(//……)。卖个关子,到 CSS 50周年的时候我告诉为啥一开始 CSS 没单行注释。Yes, pre-processors make a lot of sense. We should probably take the five or so most popular features from pre-processors and add them to CSS itself. My own favorites would be nested selectors, and single-line comments (starting with //). When CSS turns 50 I’ll tell you why they were not part of CSS from the beginning.

CSS 发明者 Håkon Wium Lie 访谈(三)相关推荐

  1. CSS叠层样式表(三)

    CSS叠层样式表(三) 文档流 display和visibility属性 定位 浮动 背景 文档流 display和visibility属性 display属性定义了元素的基本显示方式,它的常用值包括 ...

  2. css table设置边框_(代码示例)css实现等高布局的三种方式

    本篇文章给大家带来的内容是关于css实现等高布局的三种方式(代码示例),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 本文讲的等高布局是在不手动设置元素高度的情况下,使用纯css实现 ...

  3. html按钮disabled状态,CSS定义input disabled样式的三种方法

    表单提交的时候我们经常会让提交按钮禁用,满足条件后按钮恢复,disabled禁用按钮后怎么用CSS来改变禁用disabled按钮的样式呢?下面看青岛星网:CSS定义input disabled样式的三 ...

  4. 顶尖CSS Web设计师Andy Clarke访谈

    2019独角兽企业重金招聘Python工程师标准>>> 简单介绍IOTBS之后,现在介绍其中一个设计师Andy Clarke,他是Stuff and Nonsense创意总监.And ...

  5. CSS之Responsive网页设计的三个特性

    Responsive网页设计无疑是网页设计中的一个热门话题.某种程度上,他将是一个最受欢迎的网页设计概念,因为随着网站用户日渐多样化的访问方法,比如说"iPad"."iP ...

  6. 用CSS的float和clear创建三栏液态布局的方法(转载)

    三栏布局是目前最常见的网页布局,主要页内容放在中间一栏,边上的两栏放置导航链接之类的内容.基本布局一般是标题之下放置三栏,三栏占据整个页面的宽度,最后在页的底端放置页脚,页脚也占据整个页面宽度.   ...

  7. 《CSS基础教程》 读书笔记三

    1.元素总宽度=容器宽度+padding+border; 2.对这些布局有所了解是一回事,真正实施布局是另外一回事,真正从头开始实施布局是完全掌握这些方法的唯一途径. 3.理智使用display:no ...

  8. html中页面整体居中,css实现网页内容整体居中的三种方法总结

    下面我们来看一款利用css实现div中内容居中的方法,下面整理了三种css实现网页内容整体居中方法,希望对各位朋友会有所帮助. 例 代码如下 复制代码 -//W3C//DTD XHTML 1.0 Tr ...

  9. css中脱离标准流的三种方式,CSS的三种手段让元素脱离标准本文档流

    1.浮动 浮动是CSS中用到的最多的一个选项,他有三个性质.关于浮动我们要强调一点,永远不是一个东西单独浮动,浮动都是一起浮动,要浮动,大家都浮动. 1.1 浮动元素脱离标准文档流 1.1.1 大概描 ...

最新文章

  1. 3_深度学习中显卡的使用和显存的分配(20181213)
  2. 详细的mongo工具手册,包含常见CURD+条件操作+聚合+案例
  3. TAJ齐发力 互联网巨头抢滩“区块链+票据”市场
  4. bugku 杂项 2B
  5. 不用GD32?我把STM32换成了国产MM32
  6. c++中友元函数详解
  7. python3异常_python3 异常处理
  8. python实现单链表快速排序升序linkedqueue_数据结构回顾
  9. lxde 的安装和卸载以及注意事项,lubuntu
  10. Linux系统安全加固策略(二)
  11. python百度贴吧怎么爬取最早的帖子_Python爬虫爬取百度贴吧的帖子
  12. python创建文件对象的函数_Python学习笔记之—— File(文件) 对象常用函数
  13. sqlmap使用教程大全命令大全(图文)
  14. 【学习笔记】福州大学网络课程 网络空间安全概论(1,4)
  15. PMP考纲改版又又又延期了
  16. HTTP 的前世今生
  17. 修改rpg maker mv的几种上限2020-05-25
  18. sporadic偶发实时任务多核分区动态优先级EDF(或者DM)调度(以及可调度性分析)经典算法详解
  19. K8S学习--Kubeadm-4-测试运行Nginx+Tomcat
  20. 阿里巴巴P8架构师传授的这份在GitHub标星75K的微服务笔记为何有如此大的魅力?

热门文章

  1. UE4 EventTick
  2. python爬取豆瓣读书并进行图形化分析
  3. leetcode | 假设你正在爬楼梯。需要 n 阶你才能到达楼顶。每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢?
  4. 如果有人证明出来哥德巴赫猜想会有啥成就?
  5. 7-112 斐波那契数列 (10 分)
  6. Python解析html获取超链接地址并下载解析
  7. SpringMVC-详解
  8. SAP实施案例之亨得利集团
  9. 雷军亲自打造的套餐了解下:用多少付多少
  10. PTA 1094 谷歌的招聘(Python3)