Question

  • html

  1. 关于html头部的声明前缀,DTD(文档类型定义)十一组机器可读的规则,他们定义xml或HTML的特定版本中允许有什么,不允许有什么。浏览器在解析网页时,通过这些规则来检查网页的有效性及其采取相应的措施,浏览器通过页面的DOCTYPE声明来了解使用哪个DTD
  2. 普通文档流中块级元素的垂直外边距才会放生外边距叠加,行内框,浮动框或绝对定位框的外边距不会叠加。
  3. 行内框(行内元素),使用水平内边距,边框和外边距调整他们的水平间距,但是垂直内边距,边框和外边距不影响行内框的高度,同样在行内框上显示设置高度和宽度也没有影响。行框(包含行内框)通过设置行框的高度来设置行内框的高度。
  • javascript

  1. 创建原生方法:使用继承 prototype
  2. 变量提升:若在一个函数中,在变量声前使用了该变量,则该变量为未定义。实际是在执行时,该变量会被率先声明但是不会被赋值。
  3. 关于this:this总指向当前运行中的对象
  4. 关于call()和apply(): this.foo(arg1,arg2,arg3){} 等于 foo.call(this,arg1,arg2,arg3) 等于 foo.apply(this,arguments); 当传入的参数为固定时都可以用,当传入的参数不固定时使用apply
  • css

  1. position: absolute;

    An element with position: absolute; is positioned relative to the nearest positioned ancestor (instead of positioned relative to the viewport, like fixed).

    However; if an absolute positioned element has no positioned ancestors, it uses the document body, and moves along with page scrolling.

    Note: A "positioned" element is one whose position is anything except static.

  2. Hiding an element can be done by setting the display property to none. The element will be hidden, and the page will be displayed as if the element is not there:

    visibility:hidden; also hides an element.

    However, the element will still take up the same space as before. The element will be hidden, but still affect the layout:

  3. When setting the style for several link states, there are some order rules:

    • a:hover MUST come after a:link and a:visited
    • a:active MUST come after a:hover
posted @ 2017-03-04 10:27  木踢踢  阅读(121)  评论(0编辑  收藏  举报