Eric Meyer又更新reset css了

前几天Eric Meyer又思考了一下reset.css的问题,于是有所更新,具体为何要这样做,请看原文Reset Revisited。注意最开始的那句

NOTE: WORK IN PROGRESS
USE WITH CAUTION AND TEST WITH ABANDON

使用需谨慎!

  1. /* http://meyerweb.com/eric/tools/css/reset/
  2.    v2.0b1 | 201101
  3.    NOTE: WORK IN PROGRESS
  4.    USE WITH CAUTION AND TEST WITH ABANDON */
  5.  
  6. html, body, div, span, applet, object, iframe,
  7. h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  8. a, abbr, acronym, address, big, cite, code,
  9. del, dfn, em, img, ins, kbd, q, s, samp,
  10. small, strike, strong, sub, sup, tt, var,
  11. b, u, i, center,
  12. dl, dt, dd, ol, ul, li,
  13. fieldset, form, label, legend,
  14. table, caption, tbody, tfoot, thead, tr, th, td,
  15. article, aside, canvas, details, figcaption, figure,
  16. footer, header, hgroup, menu, nav, section, summary,
  17. time, mark, audio, video {
  18.     margin: 0;
  19.     padding: 0;
  20.     border: 0;
  21.     outline: 0;
  22.     font-size: 100%;
  23.     font: inherit;
  24.     vertical-align: baseline;
  25. }
  26. /* HTML5 display-role reset for older browsers */
  27. article, aside, details, figcaption, figure,
  28. footer, header, hgroup, menu, nav, section {
  29.     display: block;
  30. }
  31. body {
  32.     line-height: 1;
  33. }
  34. ol, ul {
  35.     list-style: none;
  36. }
  37. blockquote, q {
  38.     quotes: none;
  39. }
  40. blockquote:before, blockquote:after,
  41. q:before, q:after {
  42.     content: '';
  43.     content: none;
  44. }
  45.  
  46. /* remember to define visible focus styles!
  47. :focus {
  48.     outline: ?????;
  49. } */
  50.  
  51. /* remember to highlight inserts somehow! */
  52. ins {
  53.     text-decoration: none;
  54. }
  55. del {
  56.     text-decoration: line-through;
  57. }
  58.  
  59. table {
  60.     border-collapse: collapse;
  61.     border-spacing: 0;
  62. }

3 thoughts on “Eric Meyer又更新reset css了

    • 原文就是如此,:focus是用于设定获得焦点时候的样式的。比如鼠标点击链接后,出现的虚线框,这个虚线框就是outline来控制的。这里强调的是可访问性上的要求。有些用户无法使用鼠标,而只是用键盘tab导航,那这个时候如何凸显出当前获得焦点的元素,就是非常重要的了。因此,这里给出问号的目的在于,如果你不喜欢虚线框,虚线框与样式风格不符合,可以在这里重置,但必须给出新的样式,而不是仅仅把虚线框去掉,破坏可访问性。

      • 这方面 Chrome 做的很好,链接和按钮用鼠标点击的时候没有虚线,用 Tab 键的时候有虚线,不需要专门用 CSS 或 JS 处理。其次是 Opera。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>