CSS初始化代码_Div+CSS教程

编辑Tag赚U币
教程Tag:CSS初始化添加
1.
  1. charset ”utf-8″; 
  2. html {background:url(/www/pic/head_back.gif) repeat-x top #FFF} 
  3. body {width:920px;font:12px Arial;margin:0 auto;padding:0;color:#000;} 
  4. a{color:#000; text-decoration:none} 
  5. a:hover {color:#f00; text-decoration:underline} 
  6. ul,ol,p,dl{margin:0;padding:0} 
  7. ul,ol,dl{height:100%;overflow:hidden} 
  8. li{list-style:none} 
  9. img {border:none} 
  10. h1,h2,h3,h4{font:12px Verdana;margin:0;padding:0} 
  11. input {font:12px Verdana} 
2.
  1. /*为背景定义了颜色*/ 
  2. /*html { 
  3. color:#000; 
  4. background:#FFF; 
  5. }*/ 
  6. body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td { 
  7. margin:0; 
  8. padding:0; 
  9. } 
  10. /*合并边线,边线空间至零.*/ 
  11. table { 
  12. border-collapse:collapse; 
  13. border-spacing:0; 
  14. } 
  15. /*清除边线*/ 
  16. fieldset, img { 
  17. border:0; 
  18. } 
  19. address, caption, cite, code, dfn, em, strong, th, var { 
  20. font-style:normal; 
  21. font-weight:normal; 
  22. } 
  23. li { 
  24. list-style:none; 
  25. } 
  26. caption, th { 
  27. text-align:left; 
  28. } 
  29. h1, h2, h3, h4, h5, h6 { 
  30. font-size:100%; 
  31. font-weight:normal; 
  32. } 
  33. /*添加空字符清除融合*/ 
  34. q:before, q:after { 
  35. content:”; 
  36. } 
  37. abbr, acronym { 
  38. border:0; 
  39. font-variant:normal; 
  40. } 
  41. /* to preserve line-height and selector appearance */ 
  42. sup { 
  43. vertical-align:text-top; 
  44. } 
  45. sub { 
  46. vertical-align:text-bottom; 
  47. } 
  48. input, textarea, select { 
  49. font-family:inherit; 
  50. font-size:inherit; 
  51. font-weight:inherit; 
  52. } 
  53. /*to enable resizing for IE*/ 
  54. /*在ie下重定义*/ 
  55. input, textarea, select { 
  56. *font-size:100%; 
  57. } 
  58. /*because legend doesn’t inherit in IE */ 
  59. /*IE下legend不继承 */ 
  60. legend { 
  61. color:#000; 
  62. } 

来源:52CSS//所属分类:Div+CSS教程/更新时间:2012-08-06
相关Div+CSS教程: