定位

position:

    static : 按文档流输出

    relative: 其实是 relative to self 的文档流进行 偏移(left, top, 设置偏移)(元素显示偏移了,但在文档中还是占用那个空间)

    absolute: 脱离文档流,相对 自己的已定位祖父元素的偏移(left, top) (元素显示偏移了,而且在文档中不占用空间)

    fixed: 脱离文档流, 真正的绝对定位,相对文档窗口定位.(元素显示偏移了,而且在文档中不占用空间)

 

使用 relative, absolute, fixed定位的元素就是 已定位的元素, body是顶层已定位元素。

 


clear: left, right, both, none

 

Box Model

    六种盒子: 内联, 内联块, 块, 表格, 绝对定位,浮动。

  display: inline (内联盒子), block(块盒子), inline-block(内联块盒子)

    position: absolute, fixed.    (绝对定位盒子)

    float: left, right, both, none (浮动盒子)

 

    margin, border, padding, overflow, width, height, left, top.

 

    inline box: width,height和overflow不起作用。

 

选择符:

tagname #id

selector[attribute="value"]

.classname  selector:pesudo-class  *.classname.subclass 

selector:pesudo-object

selector 空白符 descendent_selector

selector > child_selector

selector+sibling-selector

 

相关文章:

  • 2021-07-19
  • 2021-07-04
  • 2022-01-26
  • 2021-05-21
  • 2021-05-27
  • 2022-01-18
  • 2021-04-03
  • 2021-04-12
猜你喜欢
  • 2021-10-19
  • 2021-05-31
  • 2021-12-17
  • 2021-07-01
  • 2021-09-03
  • 2022-02-20
相关资源
相似解决方案