前端杂疑

2015-06-21  本文已影响0人  lozio

一. display:[inline/block/inline-block/none]

Inline Elements:
  1. respect left & right margins and padding, but not top & bottom
  2. cannot have a width and height set
  3. allow other elements to sit to their left and right
Block elements:
  1. respect all of those
  2. force a line break after the block element
Inline-block elements:
  1. allow other elements to sit to their left and right
  2. respect top & bottom margins and padding
  3. respect height and width
none
  1. display:none 不占据任何空间
  2. visibility:hidden 占据普通流内的空间

二、Cookies

  1. BOM提供了储存和提取Cookie的接口: 利用document.cookie对象来存取cookie,但是原生的JavaScript不提供具体操作Cookie的方法。

三、link与@import

  1. 页面加载时,同时加载link; 而@import应用的css等页面加载完毕后加载
  2. link的权重比@import大

四、盒子模型

  1. 分为IE盒子模型和标准w3c盒子模型;IE的content部分包含border和padding;
  2. 标准的盒子部分分为4部分: content、padding、margin、border

五、选择器、优先级算法、CSS3新增伪类

优先级:
!important > id > class > tag
important > 内联 > id

CSS3伪类:

position:[absolute, relative, fiexed]

上一篇 下一篇

猜你喜欢

热点阅读