CSS常用代码1

  1. ==========CSS常用代码===========
  2. 字体颜色 : color : #00903A;
  3. 背景颜色 : background-color : #7CFFE7;
  4. --------------------------------------------------------------------------------
  5. 边框宽度 : border-width : 5px;
  6. 上边宽度 : border-top-width : 5px;
  7. 左边宽度 : border-left-width : 5px;
  8. 右边宽度 : border-right-width : 5px;
  9. 底边宽度 : border-bottom-width : 5px;
  10. --------------------------------------------------------------------------------
  11. 边框颜色 : border-color : #000FF4;
  12. 上边颜色 : border-top-color : #10FF01;
  13. 左边颜色 : border-left-color : #FF3B04;
  14. 右边颜色 : border-right-color : #FF3CF3;
  15. 底边颜色 : border-bottom-color : #00D0C3;
  16. --------------------------------------------------------------------------------
  17. 边框样式 : border-style : double; 可替换 dashed; dotted; none;
  18. 上边样式 : border-top-style : solid;
  19. 左边样式 : border-left-style : inset;
  20. 右边样式 : border-right-style : ridge;
  21. 底边样式 : border-bottom-style : solid;
  22. --------------------------------------------------------------------------------
  23. 整体宽度 : width : 5px;
  24. 整体高度 : height : 5px;
  25. 溢出选项 : overflow : visible; 可替换 hidden; scroll; auto;
  26. --------------------------------------------------------------------------------
  27. 内侧边距 : padding : 5px;
  28. 上内边距 : padding-top : 5px;
  29. 左内边距 : padding-left : 5px;
  30. 右内边距 : padding-right : 5px;
  31. 底内边距 : padding-bottom : 5px;
  32. --------------------------------------------------------------------------------
  33. 外侧边距 : margin : 5px;
  34. 上外边距 : margin-top : 5px;
  35. 左外边距 : margin-left : 5px;
  36. 右外边距 : margin-right : 5px;
  37. 底外边距 : margin-bottom : 5px;
  38. --------------------------------------------------------------------------------
  39. 文字字体 : font-family : fantasy;
  40. 文字大小 : font-size : 12pt;
  41. 文字粗细 : font-weight : bold;
  42. 文字样式 : font-style : italic;
  43. 文字变量 : line-height : 110%;
  44. --------------------------------------------------------------------------------
  45. 清除属性 : clear : left; 可替换 right; both; none;
  46. 浮动属性 : float : left; 可替换 right; none;
  47. 水平排列 : text-align : left; 可替换 right; center; justify;
  48. 文本修饰 : text-decoration : underline; 可替换 overline; underline overline; line-through; blink;
  49. 文本缩进 : text-indent : 5em;
  50. 文字间距 : letter-spacing : 5px;
  51. 字母间距 : word-spacing : 5px;
  52. 文本转换 : text-transform : capitalize; 可替换 lowercase; uppercase;
  53. 垂直排列 : vertical-align : baseline; 可替换 top; middle; bottom; text-top; text-bottom; super; sub; 3em; 30%;
  54. --------------------------------------------------------------------------------
  55. 背景图片 : background-image : url(tianyi.gif);
  56. 背景拉伸 : background-repeat : repeat; 可替换 repeat-x; repeat-y; no-repeat;
  57. 背景定位 : background-position : left; 可替换 right; top; left top; right bottom; 30% 50%;
  58. 附加属性 : background-attachment : fixed; 可替换 scroll;
  59. --------------------------------------------------------------------------------
  60. 显示属性 : display : none; 可替换 block; inline; run-in; compact; list-item; marker;
  61. 是否可见 : visibility : visible; 可替换 hidden;
  62. 资源定位 : position : static; 可替换 relative; absolute; fixed;
  63. 距离顶部 : top : 5px;
  64. 距离左边 : left : 5px;
  65. 距离右边 : right : 5px;
  66. 距离底边 : bottom : 5px;
  67. 优先等级 : z-index : 5;
  68. 鼠标指针 : cursor : crosshair; 可替换 default; pointer; move; text; wait; help; n-resize; s-resize; w-resize; e-resize; ne-resize; nw-resize; se-resize; sw-resize;
  69. 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/lenhan12345/archive/2006/12/22/1453079.aspx