css初始化代码

来源:互联网 发布:政府网络危机公关案例 编辑:程序博客网 时间:2024/06/05 19:29
CSS初始化是指重设浏览器的样式。不同的浏览器默认的样式可能不尽相同,所以开发时的第一件事可能就是如何把它们统一。如果没对CSS初始化往往会出现浏览器之间的页面差异。每次新开发网站或新网页时候通过初始化CSS样式的属性,为我们将用到的CSS或html标签更加方便准确,使得我们开发网页内容时更加方便简洁,同时减少css代码量,节约网页下载时间。
                    
            
  1. /*css reset code */
  2. http://www.kmnk03.com/hxpfk/dzpz/261.html
  3. /****  文字大小初始化,使1em=10px *****/
  4. body {
  5. font-size:62.5%;
  6. } /* for IE/Win */
  7. html>body {
  8. font-size:10px;
  9. } /* for everything else */
  10. http://www.kmnk03.com/hxpfk/npx/254.html
  11. /*字体边框等初始化*/
  12. body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
  13. padding: 0;
  14. margin: 0;
  15. }http://www.kmnk03.com/hxpfk/qcd/262.html
  16. table {
  17. border-collapse: collapse;
  18. border-spacing: 0;
  19. }
  20. fieldset,img {
  21. border: 0;
  22. }http://www.kmnk03.com/hxpfk/bpy/260.html
  23. img {
  24. display:block;
  25. }
  26. address,caption,cite,code,dfn,th,var {
  27. font-weight: normal;
  28. font-style: normal;
  29. }
  30. ol,ul {
  31. list-style: none;
  32. }http://www.kmnk03.com/hxpfk/qcd/263.html
  33. caption,th {
  34. text-align: left;
  35. }
  36. h1,h2,h3,h4,h5,h6 {
  37. font-weight: normal;
  38. font-size: 100%;
  39. }
  40. q:before,q:after {
  41. content:'';
  42. }
  43. abbr,acronym { border: 0;
  44. }http://www.kmnk03.com/hxpfk/npx/255.html
  45. a {
  46. text-decoration:none;
  47. }
复制代码
                                            
                                        
                                        
            
  1. body,ol,ul,h1,h2,h3,h4,h5,h6,p,th,td,dl,dd,form,fieldset,legend,input,textarea,select{margin:0;padding:0}   
  2. body{font:12px"宋体","Arial Narrow",HELVETICA;background:#fff;-webkit-text-size-adjust:100%;}   
  3. a{color:#2d374b;text-decoration:none}   
  4. a:hover{color:#cd0200;text-decoration:underline}   
  5. em{font-style:normal}http://www.kmnk03.com/hxpfk/bdf/256.html   
  6. li{list-style:none}   
  7. img{border:0;vertical-align:middle}   
  8. table{border-collapse:collapse;border-spacing:0}   
  9. p{word-wrap:break-word}
复制代码
                                            
                                        
                                        
            
  1. body,ul,ol,li,p,h1,h2,h3,h4,h5,h6,form,fieldset,table,td,img,div{margin:0;padding:0;border:0;}
  2. body{background:#fff;color:#333;font-size:12px; margin-top:5px;font-family:"SimSun","宋体","Arial Narrow";}
  3. ul,ol{list-style-type:none;}
  4. select,input,img,select{vertical-align:middle;}
  5. http://www.kmnk03.com/hxpfk/bdf/257.html
  6. a{text-decoration:none;}
  7. a:link{color:#009;}
  8. a:visited{color:#800080;}
  9. a:hover,a:active,a:focus{color:#c00;text-decoration:underline;}
复制代码
                                            
                                        
                                        
            
  1. body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td { margin:0; padding:0; }
  2. body, button, input, select, textarea { font:12px/1.5tahoma, arial, \5b8b\4f53; }
  3. h1, h2, h3, h4, h5, h6{ font-size:100%; }
  4. address, cite, dfn, em, var { font-style:normal; }
  5. code, kbd, pre, samp { font-family:couriernew, courier, monospace; }
  6. small{ font-size:12px; }http://www.kmnk03.com/hxpfk/tf/258.html
  7. ul, ol { list-style:none; }
  8. a { text-decoration:none; }
  9. a:hover { text-decoration:underline; }
  10. sup { vertical-align:text-top; }
  11. sub{ vertical-align:text-bottom; }
  12. legend { color:#000; }http://www.kmnk03.com/hxpfk/tf/259.html
  13. fieldset, img { border:0; }
  14. button, input, select, textarea { font-size:100%; }kmnk03.com
  15. table { border-collapse:collapse; border-spacing:0; }www.kmnk03.com
0 0
原创粉丝点击