HTML

  • tabel 不能设置高
  • form不能嵌套
  • form提交

    • If a form has only one input field then hitting enter in this field > triggers form submit (ngSubmit)
      如果表单只有一个input,那么在这个input中点击enter将会提交表单
    • if a form has 2+ input fields and no buttons or input[type=submit] > then hitting enter doesn’t trigger submit
      如果表单中有多个input,而没有button或input[type=submit],点击enter也不会提交表单。
    • if a form has one or more input fields and one or more buttons or > input[type=submit] then hitting enter in any of the input fields will >trigger the click handler on the first button or input[type=submit] –(ngClick) and a submit handler on the enclosing form (ngSubmit) 若表单中有若干input,和多个button/input[type=submit]。当在某个input中点击enter时,将会触发第一个button/input[type=submit]绑定的方法和ngSubmit绑定的方法。
  • 当非float的元素和float的元素在一起的时候,如果非float元素在先,那么float的元素将被排斥也就是说,你的span是float:right,但是你文本还是float:none。

  • 三栏布局

    • 参考
      我熟知的三栏布局
    • 绝对定位法

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      <div class="content">
      <div class="left"></div>
      <div class="main"></div>
      <div class="right"></div>
      </div>

      .content {
      position: relative;

      .main {
      margin: 0 300px;
      }

      .left {
      width:300px;
      position: absolute;
      left: 0;
      }

      .right {
      width:300px;
      position: absolute;
      right: 0;
      }
      }
* margin负值法

    中间的主体要使用双层标签。外层div宽度100%显示,并且浮动(本例左浮动,下面所述依次为基础),内层div为真正的主体内容,含有左右210像素的margin值。左栏与右栏都是采用margin负值定位的,左栏左浮动,margin-left为-100%,由于前面的div宽度100%与浏览器,所以这里的-100%margin值正好使左栏div定位到了页面的左侧;右侧栏也是左浮动,其margin-left也是负值,大小为其本身的宽度即200像素。

    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<div class="content">
<div class="left"></div>
<div class="main">
<div class="body"></div>
</div>
<div class="right"></div>
</div>

.main, .left, .right {
float: left;
}
.main {
width: 100%;
.body {
margin: 0 210px;
}
}


.left {
margin-left: -100%;
}

.right {
margin-left: -200px;
}


.left, .right {
width: 200px;
}
* 自身浮动法
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<div class="content">
<div class="left"></div>
<div class="main"></div>
<div class="right"></div>
</div>

.main {
margin: 0 210px;
}

.left, .right {
width: 200px;
}

.left, .main {
float: left;
}

.right {
float: right;
}
  • === 比较时会先比较类型,如果类型不相等直接返回false。
  • 使用 == 比较字符串和数字时会出现 0 == ‘’ //true的情况
  • this.options = $.extend({}, Button.DEFAULTS, options)
  • $scope.$watch

像素

  • 参考链接 https://github.com/amfe/article/issues/17#issuecomment-267261779
  • 物理像素

    物理像素又被称为设备像素,他是显示设备中一个最微小的物理部件。

  • 设备独立像素

    设备独立像素也称为密度无关像素,可以认为是计算机坐标系统中的一个点,这个点代表一个可以由程序使用的虚拟像素(比如说CSS像素),

  • 设备像素比(Device Pixel Ratio)

    设备像素比简称为dpr,其定义了物理像素和设备独立像素的对应关系。它的值可以按下面的公式计算得到:

    设备像素比 = 物理像素 / 设备独立像素

meta 标签

标签有很多种,而这里要着重说的是viewport的meta标签,其主要用来告诉浏览器如何规范的渲染Web页面,而你则需要告诉它视窗有多大。在开发移动端页面,我们需要设置meta标签如下: