Heim  >  Artikel  >  Web-Frontend  >  htmlcss笔记定位_html/css_WEB-ITnose

htmlcss笔记定位_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:47:12996Durchsuche

1.定位:

  position:relative(相对)

    不影响元素本身的特性;

    不使元素推理原来文档流;还占有所在的位子。

    定位元素控制:top/right/bottom/left  定位元素偏移量。

  absolute(绝对定位)

    使元素脱离文档流,

    使内嵌元素支持宽高,

    快属性标签内容撑开宽度。

    相对于整个文档发生偏移,不是相对以自身原来位置或者body来偏移;

    *如果有定位父级,就相对于定位父级定位,如果没有,则相对于文档定位

    相对定位一般情况下都是为配合绝对定位来使用的

  

  定位元素默认后者的层级高于前者。  

  定位层级:z-index:[number];默认0

   

2.透明度:ie不兼容;标准:不透明度:opacity:0~1;

          ie私有:filter:alpha(opacity=0~100);

    

3.

  登陆框体居中与整个页面:

    position:absolute;top:50%;left:50%;margin-top:-Apx;margin-left:-Bpx;

      A为登陆框体的高;B为登陆框体的宽;还要考虑边框,内边距等,

4.pisition:fixed;

  固定定位;

  特性与绝对定位基本一致,差别是始终相对于整个文档进行定位;

    ie6不支持固定定位;如需兼容需要配合JS定位。

5.position:inherit;

  从父级继承,基本不用。

6.position:static;

  默认继承;

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn