资讯专栏INFORMATION COLUMN

前端开发面试问题及答案整理

longmon / 3153人阅读

摘要:只在中存放不敏感数据,即使被盗也不会有重大损失。每个最多只能有条,每个长度不能超过,否则会被截掉。除此之外,拥有等方法,不像需要前端开发者自己封装,。控制表单控件的禁用状态。规定了三种文档类型以及。

说说你对闭包的理解 Talk about your understanding of closures

使用闭包主要是为了设计私有的方法和变量。闭包的优点是可以避免全局变量的污染,缺点是闭包会常驻内存,会增大内存使用量,使用不当很容易造成内存泄露。

Using closures designed primarily to private methods and variables. Closure advantage of global variables are avoided contamination, the disadvantage is the closure will be permanent memory, the memory usage increases, improper use is likely to cause a memory leak.

闭包有三个特性:

Closures have three characteristics:

1.函数嵌套函数
2.函数内部可以引用外部的参数和变量
3.参数和变量不会被垃圾回收机制回收

Function

The internal function nested function can refer to external parameters and variables

The parameters and variables will not be garbage collection mechanism Recycling

请你谈谈Cookie的弊端

You talk about the shortcomings of Cookie

cookie虽然在持久保存客户端数据提供了方便,分担了服务器存储的负担,但还是有很多局限性的。
第一:每个特定的域名下最多生成20个cookie

1.IE6或更低版本最多20个cookie
2.IE7和之后的版本最后可以有50个cookie。
3.Firefox最多50个cookie
4.chrome和Safari没有做硬性限制

1.IE6 or earlier up to 20 cookie 
2.IE7 later version and last may have 50 cookie. 
3.Firefox up to 50 cookie 
4.chrome and Safari does not do hard limit. IE and Opera will clean up the least recently used cookie , Firefox will randomly to clean cookie .

IEOpera 会清理近期最少使用的cookieFirefox会随机清理cookie

cookie的最大大约为4096字节,为了兼容性,一般不能超过4095字节。

IE 提供了一种存储可以持久化用户数据,叫做userdata,从IE5.0就开始支持。每个数据最多128K,每个域名下最多1M。这个持久化数据放在缓存中,如果缓存没有清理,那么会一直存在。

IE can provide a way to store persistent user data, called UserData , from IE5.0 has supported. Each data up to 128K, under each domain up to 1M. The persistent data in the cache, if not cleaned the cache, it will always exist.

优点:极高的扩展性和可用性 Advantages: high scalability and availability
1.通过良好的编程,控制保存在cookie中的session对象的大小。
2.通过加密和安全传输技术(SSL),减少cookie被破解的可能性。
3.只在cookie中存放不敏感数据,即使被盗也不会有重大损失。
4.控制cookie的生命期,使之不会永远有效。偷盗者很可能拿到一个过期的cookie。

Good programming, control the size of the session cookie stored in the object.

encryption and secure transmission technology (SSL), to reduce the possibility of cookie to crack.

Only non-sensitive data is stored in a cookie, even if stolen will not have significant losses.

Control cookie lifetime, so it will not always be effective. Theft are likely to get an expired cookie.

缺点: Disadvantages:
1.`Cookie`数量和长度的限制。每个domain最多只能有20条cookie,每个cookie长度不能超过4KB,否则会被截掉。

2.安全性问题。如果cookie被人拦截了,那人就可以取得所有的session信息。即使加密也与事无补,因为拦截者并不需要知道cookie的意义,他只要原样转发cookie就可以达到目的了。

3.有些状态不可能保存在客户端。例如,为了防止重复提交表单,我们需要在服务器端保存一个计数器。如果我们把这个计数器保存在客户端,那么它起不到任何作用。

1.`Cookie` limit the number and length. Each domain can have a maximum of 20 cookie, each cookie length can not exceed 4KB, otherwise it will be truncated. 

The security issues. If the cookie is intercepted, that person can get all the session information. Even if encryption is also unhelpful, because Interceptor does not need to know the meaning of the cookie, cookie forwarding as long as he can achieve their goals.

Some state can not be stored in the client. For example, in order to prevent duplicate submission form, we need to save a counter on the server side. If we put this counter is stored in the client, then it will not achieve any effect.
Browser local storage

浏览器本地存储

在较高版本的浏览器中,js提供了sessionStorageglobalStorage。在HTML5中提供了localStorage来取代globalStorage

In later versions of the browser, JS provides sessionStorage and globalStorage . In HTML5 provides in localStorage to replace globalStorage.

html5中的Web Storage包括了两种存储方式:sessionStoragelocalStorage

html5 The Web Storage includes two storage methods: sessionStorage and localStorage .

sessionStorage用于本地存储一个会话(session)中的数据,这些数据只有在同一个会话中的页面才能访问并且当会话结束后数据也随之销毁。因此sessionStorage不是一种持久化的本地存储,仅仅是会话级别的存储。

sessionStorage data stored locally for a session (session) in which the data only in the same session of the page to access data, and when the end of the session also will be destroyed. So sessionStorage not a persistent local storage, just session-level storage.

localStorage用于持久化的本地存储,除非主动删除数据,否则数据是永远不会过期的。

And localStorage for persistent local storage, unless the initiative to remove the data, or the data is never out of date.

web storage和cookie的区别 the difference between web storage and a cookie

Web Storage的概念和cookie相似,区别是它是为了更大容量存储设计的。Cookie的大小是受限的,并且每次你请求一个新的页面的时候Cookie都会被发送过去,这样无形中浪费了带宽,另外cookie还需要指定作用域,不可以跨域调用。

Web Storage concept and cookie similar, except that it is designed for higher-capacity storage. Cookie size is limited, and every time you request a new page when the Cookie will be sent in the past, so that virtually waste bandwidth, another cookie also need to specify the scope, not cross-domain calls.

除此之外,Web Storage拥有setItem,getItem,removeItem,clear等方法,不像cookie需要前端开发者自己封装setCookie,getCookie

In addition, Web Storage has setItem, getItem, removeItem, clear methods, unlike the cookie front-end developers need their own package setCookie, getCookie.

但是cookie也是不可以或缺的:cookie的作用是与服务器进行交互,作为HTTP规范的一部分而存在 ,而Web Storage仅仅是为了在本地“存储”数据而生

But the cookie is not indispensable: cookie "s role is to interact with the server as HTTP part of the specification exists, and Web Storage simply to the local "store" raw data

浏览器的支持除了IE7及以下不支持外,其他标准浏览器都完全支持(ie及FF需在web服务器里运行),值得一提的是IE总是办好事,例如IE7、IE6中的userData其实就是javascript本地存储的解决方案。通过简单的代码封装可以统一到所有的浏览器都支持web storage

Browser support in addition to IE7 and below are not supported, other standard browsers fully support (ie and FF need to run a web server in), it is worth mentioning that IE always good things, such as IE7, IE6 in the userData fact is javascript local storage solutions. By simple code package can be unified to all the browsers support Web storage.

localStoragesessionStorage都具有相同的操作方法,例如setItem、getItemremoveItem

localStorage and sessionStorage have the same method of operation, for example setItem, getItem and removeItem etc.

cookie 和session 的区别: cookie and session distinction:
 1、cookie数据存放在客户的浏览器上,session数据放在服务器上。
 2、cookie不是很安全,别人可以分析存放在本地的COOKIE并进行COOKIE欺骗
    考虑到安全应当使用session。
 3、session会在一定时间内保存在服务器上。当访问增多,会比较占用你服务器的性能
     考虑到减轻服务器性能方面,应当使用COOKIE。
 4、单个cookie保存的数据不能超过4K,很多浏览器都限制一个站点最多保存20个cookie。
 5、所以个人建议:
    将登陆信息等重要信息存放为SESSION
    其他信息如果需要保留,可以放在COOKIE中
    
 1, cookie data is stored on the customer"s browser, session data on the server. 
 2, cookie is not very safe, others can be analyzed at a local store and COOKIE COOKIE cheat should be used taking into account the security session. 
 3, session will be within a certain time saved on the server. When accessing the increase, it would be more occupy the performance of your server consider to reduce server performance, you should use COOKIE. 
 4, the data stored in a single cookie can not exceed 4K, many browsers are limited to a maximum of one site to save 20 cookie. 
 5, so personal recommendations: the login information and other important information is stored as SESSION additional information, if necessary, it can be placed in COOKIE

CSS 相关问题

CSS-related issues display:none和visibility:hidden的区别? display: none and visibility: hidden difference?
display:none  隐藏对应的元素,在文档布局中不再给它分配空间,它各边的元素会合拢,
就当他从来不存在。

visibility:hidden  隐藏对应的元素,但是在文档布局中仍保留原来的空间。

display: none to hide the corresponding elements in the document layout is no longer space allocated to it, it is the element of each side will be closed, on when he never existed. 

visibility: hidden hides the corresponding elements, but still retain the original layout of the space in the document. The difference in the link andimport CSS is?
CSS中 link 和@import 的区别是? The difference in the link andimport CSS is?
(1) link属于HTML标签,而@import是CSS提供的; 
(2) 页面被加载的时,link会同时被加载,而@import引用的CSS会等到页面被加载完再加载;
(3) import只在IE5以上才能识别,而link是HTML标签,无兼容问题; 
(4) link方式的样式的权重 高于@import的权重.

(1) link belong to HTML tags, and CSSimport is provided; 
(2) the page is loaded, link will also be loaded, but referencesimport CSS will wait until the page is finished loading reloading; 
(3) Import only to recognize in IE5 or more, while link is HTML tag, no compatibility issues; style right 
(4) linkimport way of weight above the weight of heavy. Similarities and Differences between absolute and float attributes: position
position:absolute和float属性的异同 Similarities and Differences between absolute and float attributes: position
A:共同点:
对内联元素设置`float`和`absolute`属性,可以让元素脱离文档流,并且可以设置其宽高。

B:不同点:
float仍会占据位置,position会覆盖文档流中的其他元素。

A: common: 
inline element set `float` and` absolute` property allows elements from the document flow, and can set its width and height. 

B: Different point: 
float will still occupy the position, position overrides other elements in the document flow.
介绍一下box-sizing属性? Introduce the box-sizing property?

box-sizing属性主要用来控制元素的盒模型的解析模式。默认值是content-box
box-sizing property is primarily used to control element analytical model box model. The default value is content-Box.

content-box:让元素维持W3C的标准盒模型。元素的宽度/高度由border + padding + content的宽度/高度决定,设置width/height属性指的是content部分的宽/高

content-Box : Let element to maintain the standard W3C box model. Width / height of the element / height is determined by the border + padding + content width, set width / height attribute refers to the content portion of the width / height

border-box:让元素维持IE传统盒模型(IE6以下版本和IE6~7的怪异模式)。设置width/height属性指的是border + padding + content

border-Box : Let element to maintain the traditional box model IE (IE6 and IE6 ~ 7 the following versions of quirks mode). Set width / height attribute refers to the border + padding + content

标准浏览器下,按照W3C规范对盒模型解析,一旦修改了元素的边框或内距,就会影响元素的盒子尺寸,就不得不重新计算元素的盒子尺寸,从而影响整个页面的布局。

Under standard browser, according to W3C box model specification analysis, once the border or modify the elements within distance, it will affect the size of the box element, you have to recalculate the box the size of the elements, thus affecting the layout of the entire page.

CSS 选择符有哪些?哪些属性可以继承?优先级算法如何计算? CSS3新增伪类有那些? CSS selectors are there? Which attributes can be inherited? Priority algorithm calculated? Added CSS3 pseudo-classes are those?
1.id选择器( # myid)
2.类选择器(.myclassname)
3.标签选择器(div, h1, p)
4.相邻选择器(h1 + p)
5.子选择器(ul > li)
6.后代选择器(li a)
7.通配符选择器( * )
8.属性选择器(a[rel = "external"])
9.伪类选择器(a: hover, li:nth-child)

1.id selector (# myid) 

Class selector (.myclassname)

Tag selectors (div, h1, P)

adjacent selector (h1 + P)

child selector (ul> li )

descendant selectors (li a)

wildcard selector (*)

attribute selector (a [rel = "external"])

pseudo-class selectors (a: hover, li: nth-child)

可继承的样式: font-size font-family color, text-indent;

不可继承的样式:border padding margin width height ;

优先级就近原则,同权重情况下样式定义最近者为准;

载入样式以最后载入的定位为准;

Inheritable style: font-size font-family color, text-indent;

Non Inherited Styles: border padding margin width height;

Priority under the principle of proximity, with weights whichever the case recently defined style;

Loading last loaded positioning styles to prevail;

优先级为:

Priority:

  
  
!important >  id > class > tag  
  
important 比 内联优先级高,但内联比 id 要高

CSS3新增伪类举例:

   
p:first-of-type 选择属于其父元素的首个 

元素的每个

元素。 p:last-of-type 选择属于其父元素的最后

元素的每个

元素。 p:only-of-type 选择属于其父元素唯一的

元素的每个

元素。 p:only-child 选择属于其父元素的唯一子元素的每个

元素。 p:nth-child(2) 选择属于其父元素的第二个子元素的每个

元素。 :enabled :disabled 控制表单控件的禁用状态。 :checked 单选框或复选框被选中。

position的值, relative和absolute分别是相对于谁进行定位的? position values, relative and absolute are positioned with respect to whom?
absolute 
        生成绝对定位的元素, 相对于最近一级的 定位不是 static 的父元素来进行定位。

fixed (老IE不支持)
    生成绝对定位的元素,相对于浏览器窗口进行定位。 

relative 
    生成相对定位的元素,相对于其在普通流中的位置进行定位。 

static  默认值。没有定位,元素出现在正常的流中

absolute 
    generate absolute element positioned relative to the recent level is not static positioned parent element to be positioned. 

fixed (old IE does not support) 
    to generate absolute element positioned relative to the browser window positioning. 

relative 
    generating element relative positioning, relative to its position in the general stream positioning. 

static default. No positioning element occurs in the normal stream
CSS3有哪些新特性? CSS3 What"s new?
CSS3实现圆角(border-radius),阴影(box-shadow),
对文字加特效(text-shadow、),线性渐变(gradient),旋转(transform)
transform:rotate(9deg) scale(0.85,0.90) translate(0px,-30px) skew(-9deg,0deg);//旋转,缩放,定位,倾斜
增加了更多的CSS选择器  多背景 rgba 
在CSS3中唯一引入的伪元素是::selection.
媒体查询,多栏布局
border-image

CSS3 rounded corners (border-radius), shadow (box-shadow), 
add special effects to the text (text-shadow,), a linear gradient (gradient), rotation (transform) 
transform: Rotate (9deg) Scale (0.85,0.90) translate (0px, -30px) skew (-9deg, 0deg); // rotation, scaling, positioning, tilt 
adds more CSS selectors more background rgba 
unique introduced in CSS3 pseudo-elements :: selection. 
Media queries , multi-column layout 
border-image
  
XML和JSON的区别? XML and JSON difference?
(1).数据体积方面。
JSON相对于XML来讲,数据的体积小,传递的速度更快些。
(2).数据交互方面。
JSON与JavaScript的交互更加方便,更容易解析处理,更好的数据交互。
(3).数据描述方面。
JSON对数据的描述性比XML较差。
(4).传输速度方面。
JSON的速度要远远快于XML。

(1) The data volume terms. 
XML JSON relative terms, the volume of data is small, the speed of delivery faster. 
(2) aspects of data exchange. 
JSON and JavaScript interaction more convenient and easier to parse processing, better data interaction. 
(3) The data described aspects. 
JSON description of data than XML poor. 
(4) The transmission speed. 
JSON"s speed is much faster than XML.
对BFC规范的理解? BFC norms of understanding?
      BFC,块级格式化上下文,一个创建了新的BFC的盒子是独立布局的,盒子里面的子元素的样式不会影响到外面的元素。在同一个BFC中的两个毗邻的块级盒在垂直方向(和布局方向有关系)的margin会发生折叠。
    (W3C CSS 2.1 规范中的一个概念,它决定了元素如何对其内容进行布局,以及与其他元素的关系和相互作用。)
    BFC, block-level formatting context, a BFC created a new box is an independent layout, style, child elements inside the box will not affect the outside elements. In the same BFC two adjoining block-level box in the vertical direction (the direction of a relationship and layout) of margin will collapse from happening. 
    (A concept W3C CSS 2.1 specification, which determines how the elements in the layout of its contents, and its relationship with other elements and interactions.)
解释下 CSS sprites,以及你要如何在页面或网站中使用它。 Talk about your understanding of the semantic?
CSS Sprites其实就是把网页中一些背景图片整合到一张图片文件中,再利用CSS的“background-image”,“background- repeat”,“background-position”的组合进行背景定位,background-position可以用数字能精确的定位出背景图片的位置。这样可以减少很多图片请求的开销,因为请求耗时比较长;请求虽然可以并发,但是也有限制,一般浏览器都是6个。对于未来而言,就不需要这样做了,因为有了`http2`。
CSS Sprites in fact, the number of pages in the background image into an image file, and then use the CSS "background-image", "background- repeat", "background-position" a combination of background positioning, background-position can be used Digital can accurately locate the position of the background image. This can reduce the cost of many pictures request because the request takes a relatively long; although requests can be complicated, but there are limits, are six general browser. For the future, there is no need to do so, and because of `http2`.
html部分 html part 说说你对语义化的理解? Talk about your understanding of the semantic?
1,去掉或者丢失样式的时候能够让页面呈现出清晰的结构
2,有利于SEO:和搜索引擎建立良好沟通,有助于爬虫抓取更多的有效信息:爬虫依赖于标签来确定上下文和各个关键字的权重;
3,方便其他设备解析(如屏幕阅读器、盲人阅读器、移动设备)以意义的方式来渲染网页;
4,便于团队开发和维护,语义化更具可读性,是下一步吧网页的重要动向,遵循W3C标准的团队都遵循这个标准,可以减少差异化。

1, removed or lost when allowing page style showing clear structure 
2, is conducive to SEO: search engines and to establish good communication helps crawlers to crawl more useful information: reptiles rely on labels to determine the context and the individual right keyword weight; 
3, easy to resolve other devices (such as a screen reader, blind readers, mobile devices) in meaningful ways to render web pages;     4, easy to team development and maintenance, more readable semantic, is under Important Trends step right of the page, follow the W3C standards team follow this standard, the difference can be reduced.
Doctype作用? 严格模式与混杂模式如何区分?它们有何意义? Doctype role? Strict mode and mixed mode how to distinguish? They mean?
(1)、 声明位于文档中的最前面,处于  标签之前。告知浏览器以何种模式来渲染文档。 

(2)、严格模式的排版和 JS 运作模式是  以该浏览器支持的最高标准运行。

(3)、在混杂模式中,页面以宽松的向后兼容的方式显示。模拟老式浏览器的行为以防止站点无法工作。

(4)、DOCTYPE不存在或格式不正确会导致文档以混杂模式呈现。  

(1),  declaration in the document in the front, in the  tag before. Tells the browser to render the document in which mode. 

(2) strict mode layout and JS mode of operation is based on the highest standards of the browser supports running. 

(3), in promiscuous mode, page backward compatible with liberal display. Simulate the behavior of older browsers do not work to prevent the site. 

(4), DOCTYPE does not exist or incorrectly formatted document will lead to promiscuous mode rendering.   
你知道多少种Doctype文档类型? Do you know how many document types Doctype?
 该标签可声明三种 DTD 类型,分别表示严格版本、过渡版本以及基于框架的 HTML 文档。
 HTML 4.01 规定了三种文档类型:Strict、Transitional 以及 Frameset。
 XHTML 1.0 规定了三种 XML 文档类型:Strict、Transitional 以及 Frameset。
Standards (标准)模式(也就是严格呈现模式)用于呈现遵循最新标准的网页,而 Quirks
 (包容)模式(也就是松散呈现模式或者兼容模式)用于呈现为传统浏览器而设计的网页。
 
 The label can be declared DTD three types, respectively strict version, interim version and an HTML-based documentation framework. 
 HTML 4.01 specifies three document types: Strict, Transitional, and Frameset. 
 XHTML 1.0 specifies three XML document types: Strict, Transitional, and Frameset. 
 Standards (standard) mode (that is, in strict rendering mode) complies with the latest standards for rendering Web pages, while Quirks 

(inclusive) mode (that is, loose rendering mode or compatibility mode) is used to render conventional web browser designed.

HTML与XHTML——二者有什么区别 HTML and XHTML-- What is the difference
区别:
1.所有的标记都必须要有一个相应的结束标记
2.所有标签的元素和属性的名字都必须使用小写
3.所有的XML标记都必须合理嵌套
4.所有的属性必须用引号""括起来
5.把所有<和&特殊符号用编码表示
6.给所有属性赋一个值
7.不要在注释内容中使“--”
8.图片必须有说明文字

Difference: 

All tags must have a corresponding end tag element and attribute names

All tags must be lowercase

All the XML tags must be properly nested

All attributes must be quoted. " "enclosed

Put all the

assign a value to all of the properties in the comment 7. Do not manipulation "-"

The image must have caption

常见兼容性问题? Common compatibility problems?

png24位的图片在iE6浏览器上出现背景,解决方案是做成PNG8.也可以引用一段脚本处理.

浏览器默认的margin和padding不同。解决方案是加一个全局的*{margin:0;padding:0;}来统一。

IE6双边距bug:块属性标签float后,又有横行的margin情况下,在ie6显示margin比设置的大。

浮动ie产生的双倍距离(IE6双边距问题:在IE6下,如果对元素设置了浮动,同时又设置了margin-left或margin-right,margin值会加倍。)
#box{ float:left; width:10px; margin:0 0 0 100px;}

这种情况之下IE会产生20px的距离,解决方案是在float的标签样式控制中加入 ——_display:inline;将其转化为行内属性。(_这个符号只有ie6会识别)

渐进识别的方式,从总体中逐渐排除局部。

Png24 bit image appears on iE6 browser background, the solution is made ​​PNG8. It can refer to a script processing.

The browser"s default margin and padding. The solution is to add a global * {margin: 0; padding: 0;} to unify.

IE6 bilateral Distance bug: After the block attribute labels float, there are rampant margin circumstances, in ie6 show larger margin than the settings.

Double ie generated from the float (IE6 bilateral distance problem: In IE6, if the element is set to float, while setting the margin-left or margin-right, margin value will double.)
#box {float: left; width: 10px; margin: 0 0 0 100px;}

Under such circumstances IE will produce 20px distance, the solution is to add --_ display in the label style float control: inline; be converted to inline property. (_ This symbol identifies only ie6)

gradual recognition of the way from the local population gradually excluded.

首先,巧妙的使用“9”这一标记,将IE游览器从所有情况中分离出来。
接着,再次使用“+”将IE8和IE7、IE6分离开来,这样IE8已经独立识别。

First, the clever use of " 9" This marks the IE"s browser separated out from all the circumstances.
Then, again using the "+" to IE8 and IE7, IE6 separated, so that IE8 has been independently identified.

css

  .bb{
   background-color:#f1ee18;/*所有识别*/
  .background-color:#00deff9; /*IE6、7、8识别*/
  +background-color:#a200ff;/*IE6、7识别*/
  _background-color:#1e0bd1;/*IE6识别*/ 
  } 

IE下,可以使用获取常规属性的方法来获取自定义属性,
也可以使用getAttribute()获取自定义属性;
Firefox下,只能使用getAttribute()获取自定义属性.
解决方法:统一通过getAttribute()获取自定义属性.

IE下,event对象有x,y属性,但是没有pageX,pageY属性;
Firefox下,event对象有pageX,pageY属性,但是没有x,y属性.

解决方法:(条件注释)缺点是在IE浏览器下可能会增加额外的HTTP请求数。

Chrome 中文界面下默认会将小于 12px 的文本强制按照 12px 显示,
可通过加入 CSS 属性 -webkit-text-size-adjust: none; 解决.

超链接访问过后hover样式就不出现了 被点击访问过的超链接样式不在具有hover和active了解决方法是改变CSS属性的排列顺序:
L-V-H-A : a:link {} a:visited {} a:hover {} a:active {}

怪异模式问题:漏写DTD声明,Firefox仍然会按照标准模式来解析网页,但在IE中会触发怪异模式。为避免怪异模式给我们带来不必要的麻烦,最好养成书写DTD声明的好习惯。现在可以使用html5推荐的写法:

上下margin重合问题
ie和ff都存在,相邻的两个div的margin-left和margin-right不会重合,但是margin-top和margin-bottom却会发生重合。

解决方法,养成良好的代码编写习惯,同时采用margin-top或者同时采用margin-bottom。

ie6对png图片格式支持不好(引用一段脚本处理)

under IE, you can use the method to get the general properties for custom properties,

can also use getAttribute () Gets the custom attributes;

under Firefox, only Use getAttribute () Gets custom attributes.
Workaround: Uniform for custom properties through getAttribute ().

Under IE, event object has x, y attributes, but no pageX, pageY property;

Firefox, event object has pageX, pageY property, but there is no x, y properties.

Solution :( conditional comments) drawback is that in IE browser may add additional HTTP requests.

Under Chrome Chinese interface will be smaller than default to force the 12px 12px text display,

the addition of CSS properties -webkit-text-size-adjust: none; resolved.

After hover style is not accessible by hyperlink is clicked appears visited The Hyperlink style does not have hover and active the solution is to change the order of CSS properties:
LVHA: a: link {} a: visited {} a: hover {} a: Active {}

weird modalities: Leakage write DTD statement, Firefox will still be in accordance with the standard model to resolve the page, but IE will trigger quirks mode. To avoid quirks mode gives us unnecessary trouble, it is best to develop the good habit of writing DTD declaration. You can now use [html5] (http://www.w3.org/TR/html5/single-page.html) recommended notation:

top and bottom margin overlap problem

and ff are present, adjacent both margin-left and margin-right does not coincide div, but margin-top and margin-bottom but it will coincide occur.

Solution, to develop good coding habits, while using margin-top or while using margin-bottom.

Ie6 png image format support is not good for (quote a script processing)

解释下浮动和它的工作原理?清除浮动的技巧 Floating and explain how it works? Clear float tips
浮动元素脱离文档流,不占据空间。浮动元素碰到包含它的边框或者浮动元素的边框停留。
Floating elements from the document flow, does not occupy space. Floats across the border to stay its borders contain or floating elements. 

1.使用空标签清除浮动。
   这种方法是在所有浮动标签后面添加一个空标签 定义css clear:both. 弊端就是增加了无意义标签。
2.使用overflow。
   给包含浮动元素的父标签添加css属性 overflow:auto; zoom:1; zoom:1用于兼容IE6。
3.使用after伪对象清除浮动。
   该方法只适用于非IE浏览器。具体写法可参照以下示例。使用中需注意以下几点。一、该方法中必须为需要清除浮动元素的伪对象中设置 height:0,否则该元素会比实际高出若干像素;
   

Clear float with an empty label. This method is to add an empty label definition css clear in all floating behind the label: both the disadvantages is to increase the meaningless labels.

Use the overflow. To a parent tag contains floating elements add css property overflow: auto; zoom: 1; zoom: 1 for compatibility with IE6.

Use after pseudo remove floating objects. This method applies only to non-IE browsers. Specific wording may refer to the following examples. Use should pay attention to the following points. First, the method must be set to clear the height of the floating element"s pseudo-objects: 0, otherwise the element will be much higher than the actual number of pixels;

浮动元素引起的问题和解决办法? Problems caused by floating elements and solutions?
浮动元素引起的问题:

Problems caused by the floating elements: 

(1)父元素的高度无法被撑开,影响与父元素同级的元素
(2)与浮动元素同级的非浮动元素(内联元素)会跟随其后
(3)若非第一个元素浮动,则该元素之前的元素也需要浮动,否则会影响页面显示的结构

(1) height of the parent element can not be softened, peer influence and elements of the parent element 
(2) and non-floating elements floating element siblings (inline elements) will follow thereafter 
(3) if not the first element of float, then that element is also required before the float, otherwise it will affect the structure of the page displayed

解决方法:
使用CSS中的clear:both;属性来清除元素的浮动可解决2、3问题,对于问题1,添加如下样式,给父元素添加clearfix样式:

Workaround: use CSS in Clear: Both ; attribute to clear floating elements 2,3 resolve the problem, the problem 1, add the following styles to parent element Add clearfix style:

.clearfix:after{content: ".";display: block;height: 0;clear: both;visibility: hidden;}
.clearfix{display: inline-block;} /* for IE/Mac */

清除浮动的几种方法:

1,额外标签法,
(缺点:不过这个办法会增加额外的标签使HTML结构看起来不够简洁。) 2,使用after伪类

Clear float several ways:

1, additional labeling, 
(disadvantage: But this approach would cause additional HTML tag structure looks simple enough) 2, use after pseudo-class #parent:after{ content:"."; height:0; visibility:hidden; display:block; clear:both; } 3,浮动外部元素 4,设置`overflow`为`hidden`或者auto 3, floating external element 4, is set to `hidden`` overflow` or auto
IE 8以下版本的浏览器中的盒模型有什么不同 IE 8 the following versions of the browser box model What is the difference
IE8以下浏览器的盒模型中定义的元素的宽高不包括内边距和边框

The following box model IE8 browser"s width and height defined elements does not include padding and border
DOM操作——怎样添加、移除、移动、复制、创建和查找节点。 DOM manipulation - how to add, remove, move, copy, create, and find nodes.
(1)创建新节点

      createDocumentFragment()    //创建一个DOM片段

      createElement()   //创建一个具体的元素

      createTextNode()   //创建一个文本节点

(2)添加、移除、替换、插入

      appendChild()

      removeChild()

      replaceChild()

      insertBefore() //在已有的子节点前插入一个新的子节点

(3)查找

      getElementsByTagName()    //通过标签名称

      getElementsByName()    //通过元素的Name属性的值(IE容错能力较强,会得到一个数组,其中包括id等于name值的)

      getElementById()    //通过元素Id,唯一性
      
 (1) Create a new node 

      createDocumentFragment () // Create a DOM fragment 

      createElement () // create a specific element 

      createTextNode () // Create a text node 

 (2) to add, remove, replace, insert 

      appendChild () 

      removeChild ( ) 

      replaceChild () 

      insertBefore () // before the existing child node into a new child node 

(3) Find

      getElementsByTagName () // by tag name 

      getElementsByName () // by the value of the Name property of the element (IE fault tolerance Strong, will be an array, including name id equal value) 

      getElementById () // by elemental Id, uniqueness
html5有哪些新特性、移除了那些元素?如何处理HTML5新标签的浏览器兼容问题?如何区分 HTML 和 HTML5? What"s new html5, removing those elements? How to deal with a new label HTML5 browser compatibility problems? How to distinguish between HTML and HTML5?

HTML5 现在已经不是 SGML 的子集,主要是关于图像,位置,存储,多任务等功能的增加。

拖拽释放(Drag and drop) API
语义化更好的内容标签(header,nav,footer,aside,article,section)
音频、视频API(audio,video)
画布(Canvas) API
地理(Geolocation) API
本地离线存储 localStorage 长期存储数据,浏览器关闭后数据不丢失;
sessionStorage 的数据在浏览器关闭后自动删除

表单控件,calendar、date、time、email、url、search
新的技术webworker, websocket, Geolocation

移除的元素

纯表现的元素:basefont,big,center,font, s,strike,tt,u;

对可用性产生负面影响的元素:frame,frameset,noframes;

支持HTML5新标签:

IE8/IE7/IE6支持通过document.createElement方法产生的标签,
可以利用这一特性让这些浏览器支持HTML5新标签,

浏览器支持新标签后,还需要添加标签默认的样式:

当然最好的方式是直接使用成熟的框架、使用最多的是html5shim框架

HTML5 now is not a subset of SGML, mainly to increase with respect to the image, location, storage, multi-tasking and other features.

Drag release (Drag and drop) API

content better label (header, nav, footer, aside, article, section)
audio, video, API (audio, video)

(Canvas) API

(Geolocation) API
Local localStorage offline storage for long term storage of data, the browser is closed after data is not lost;
sessionStorage of data after the browser is closed automatically delete

controls, calendar, date, time, email, url, search
WebWorker new technologies, websocket, Geolocation

Remove The elements of

the element of pure performance: basefont, big, center, font, s, strike, tt, u;

adversely affect the availability of the elements of: frame, frameset, noframes;

support HTML5 new label:

IE8 / IE7 / IE6 support through document.createElement method of producing labels,

use this feature to allow these browsers support HTML5 new label,

after the browser to support the new label, you also need to add tags default style:

Of course, the best way is the direct use of mature framework, use the most is html5shim framework

如何区分: DOCTYPE声明新增的结构元素功能元素

How to distinguish: DOCTYPE declaration new structural elements functional elements iframe advantages and disadvantages?

iframe的优缺点?
1.`