`

css 简单使用1

阅读更多
html 代码
  1.    <style type="text/css">   
  2.    positionabsolute;   
  3.    left180px;   
  4.    top56px;   
  5.   }   
  6.   </style>    
  7. < div id='Msg_div' class='Msg_div' />   

定义了 msg div 的位置。

 CSS手册:http://htmlhelp.com/zh/reference/css/structure.html

 1. 选择符:

1) html 元素选择符,如               

css 代码
  1. P { color:red }   
  2. A { color#666666}   
  3. < p >< /p >   
  4. < a href = '#' />   

2)类选择符,html 对应 class 属性 ,如                   

css 代码
  1. .smalltext  { color:red }   
  2. < div  class = ' smalltext ' / >   

3)关联选择符,如

css 代码
  1. P EM { backgroundyellow }  

4)id 选择符,不方便,应少使用,如                   

css 代码
  1. #smalltext                                < div id=' smalltext ' />    

 2. Background url 位置定位:

0px  -13px 为该图片left  , top 的位置

css 代码:             
  1. .my-shell-close {   
  2.   cursorpointer;   
  3.   backgroundurl(images/default/shell/btn-sprite.gif) no-repeat left 0px;   
  4.   width15px;   
  5.   height13px;   
  6. }   
  7.   
  8. .my-shell-min {   
  9.   cursorpointer;   
  10.   backgroundurl(images/default/shell/btn-sprite.gif) no-repeat 0px -13px;   
  11.   width13px;   
  12.   height13px;   
  13. }   
  14.   
  15. .my-shell-max {   
  16.   cursorpointer;   
  17.   backgroundurl(images/default/shell/btn-sprite.gif) no-repeat 0px -26px;   
  18.   width15px;   
  19.   height13px;   
  20. }   
  21.   
  22. .my-shell-min-over {   
  23.   backgroundurl(images/default/shell/btn-sprite.gif) no-repeat 0px -52px;   
  24. }   
  25.   
  26. .my-shell-close-over {   
  27.   backgroundurl(images/default/shell/btn-sprite.gif) no-repeat 0px -39px;   
  28. }   
  29.   
  30. .my-shell-max-over {   
  31.   backgroundurl(images/default/shell/btn-sprite.gif) no-repeat 0px -65px;   
  32. }   
分享到:
评论
1 楼 xombat 2007-10-11  
少了点东西吧

.Msg_div{

相关推荐

Global site tag (gtag.js) - Google Analytics