尝试了解一些 HTML5Boilerplate 项目

发布于 2024-10-17 19:40:41 字数 776 浏览 4 评论 0 原文

HTML5Boilerplate中,CSS中的第72行到第80行,它说:

/* fonts.css from the YUI Library: developer.yahoo.com/yui/
   Refer to developer.yahoo.com/yui/3/cssfonts/ for font sizing percentages

   There are three custom edits:
   * remove arial, helvetica from explicit font stack
   * we normalize monospace styles ourselves
   * table font-size is reset in the HTML5 reset above so there is no need
   * to repeat
*/
body { font:13px/1.231 sans-serif; *font-size:small; } /* hack retained to
                                                          preserve specificity 
                                                       */ 

我想理解的是,为什么他们提到雅虎以及“保留黑客”是什么?

In the HTML5Boilerplate, on line 72 to 80 in the css, it says:

/* fonts.css from the YUI Library: developer.yahoo.com/yui/
   Refer to developer.yahoo.com/yui/3/cssfonts/ for font sizing percentages

   There are three custom edits:
   * remove arial, helvetica from explicit font stack
   * we normalize monospace styles ourselves
   * table font-size is reset in the HTML5 reset above so there is no need
   * to repeat
*/
body { font:13px/1.231 sans-serif; *font-size:small; } /* hack retained to
                                                          preserve specificity 
                                                       */ 

What I'm trying to understand is, why do they mention Yahoo and what 'hack is retained?'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木緿 2024-10-24 19:40:41

指向雅虎的链接是指向雅虎用户界面库的链接,他们有一个东西那里

...提供跨浏览器的排版规范化和控制,同时仍然允许用户选择和调整字体大小。

这意味着 Boilerplate 使用 YUI Fonts.css 作为基础,但已从 YUI Css 文件中删除了 Arial 和 Helvetica,本身标准化了等宽样式,并且我猜删除了表格字体大小,因为它已经在 HTML5 重置中。

该 hack 是针对 IE6 的 CSS hack:*font-size:small; 仅在 IE6 及以下版本中可见。

希望其中一些有所帮助。

The link to Yahoo is a link to the Yahoo User Interface library, they have a thing there that

...provides cross-browser typographical normalization and control while still allowing users to choose and adjust their font size.

This means that Boilerplate uses the YUI Fonts.css as their base, but have removed Arial and Helvetica from the YUI Css file, have normalised monospace styles themselves and have I guess removed the table font-size because it's already in their HTML5 reset.

The hack is a CSS hack that targets IE6: *font-size:small; will only be seen by IE6 and below.

Hope some of that helps a bit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文