The most complete front-end development Interview Questions and Answers finishing

Github autumn from the original text

Talk about your understanding of closures

Talk about your understanding of closures

Using closures designed primarily for private methods and variables. Advantage of the closure can be avoided global variable pollution drawback is that the closure will be permanent memory, increases memory usage, improper use is likely to cause a memory leak.

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:

Closures have three characteristics:

The nested function 1. Function
2 can reference external to internal variables and function arguments
3. variables and parameters are not recovered garbage collection

  1. Function
  2. The internal function nested function can refer to external parameters and variables
  3. The parameters and variables will not be garbage collection mechanism Recycling

You talk about the shortcomings of Cookie

You talk about the shortcomings of Cookie

cookieAlthough persistent client data to provide a convenient, sharing the burden of server storage, but there are still many limitations.
First: Up to generate each particular domain 20cookie

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 .

IEAnd Operawill clean up the least recently used cookie, Firefoxrandomly clean up cookie.

cookieThe maximum is approximately 4096bytes for compatibility, generally can not exceed 4095bytes.

IE may provide a persistent storage of user data, is called userdata, from the IE5.0start to support. Each data up to 128K, at each domain name up to 1M. The persistent data in the cache, the cache if not cleaned, it will always exist.

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

Advantages: high scalability and availability

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

1. Good programming, control the size of the session cookie stored in the object. 
2. encryption and secure transmission technology (SSL), to reduce the possibility of cookie to crack. 
3. Only non-sensitive data is stored in a cookie, even if stolen will not have significant losses. 
4. Control cookie lifetime, so it will not always be effective. Theft are likely to get an expired cookie.

Disadvantages:

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. 

2. 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. 

3. 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

Browser local storage

In later versions of the browser, jsproviding sessionStorageand globalStorage. In the HTML5provided localStorageinstead globalStorage.

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

html5The Web Storageincluded two storage methods: sessionStorageand localStorage.

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

sessionStorageData is stored locally for a session (session) of these pages can only access data in the same session and after the session ends data also will be destroyed. So sessionStoragenot a persistent local storage, only the session-level storage.

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.

And localStoragefor persistent local storage, unless the initiative to delete data, or the data is never out of date.

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

The difference between web storage and a cookie

the difference between web storage and a cookie

Web StorageThe concept cookieis similar, except that it is designed for greater storage capacity. CookieThe size is limited, and every time you request a new page when Cookiewill be sent in the past, so that virtually wasted bandwidth, in addition cookiealso need to specify the scope, not cross-domain calls.

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.

In addition, Web Storagehas setItem,getItem,removeItem,clearother methods, not cookierequire the developer's own front end package setCookie,getCookie.

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

But cookiealso not indispensable: cookiethe role is to interact with the server as HTTPpart of the present specification, but Web Storageonly to the local "store" raw data

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

In addition to browser support IE7and below are not supported, other standard browsers fully support (ie FF and need to run a web server inside), it is worth mentioning that IE always good things, such as IE7, IE6 is userDataactually a javascriptlocal storage solutions. Can be integrated into all browsers support through simple code package 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.

localStorageAnd sessionStoragehave the same operation method, for example setItem、getItem, and removeItemthe like

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

cookie and session difference:

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-related issues

CSS-related issues

display: none and visibility: hidden the difference?

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?

The difference between the CSS @import and link is?

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

Similarities and differences between absolute and float attributes: position

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.

Tell us about the box-sizing property?

Introduce the box-sizing property?

box-sizingThe main attribute is used to parse the pattern box model control element. The default value is content-box.
box-sizing property is primarily used to control element analytical model box model. The default value is content-Box.

  • content-box: Let the elements to maintain standards of W3C box model. Width / height of the element / height determined by the width of the border + padding + content is provided width / height attribute refers to the width / height content portion
  • 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: Let the elements of the traditional box model to maintain IE (IE6 and IE6 ~ 7 following versions of quirks mode). Set width / height attribute refers to the 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

Under standard browser, according to W3C specifications for box model resolution, once modified elements from the border or inside, it will affect the size of the box element, would have to recalculate the size of the box element, thus affecting the entire page layout.

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 selectors What? What attributes can be inherited? How priority algorithm? New CSS3 pseudo-classes are those?

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) 
2. Class selector (.myclassname) 
3. Tag selectors (div, h1, P) 
4. adjacent selector (h1 + P) 
5. child selector (ul> li ) 
6. descendant selectors (li a) 
7. wildcard selector (*) 
8. attribute selector (a [rel = "external"]) 
9. pseudo-class selectors (a: hover, li: nth-child)
      
  • Inheritable style: font-size font-family color, text-indent;

  • Not inherited style: border padding margin width height;

  • Under the priority of the principle of proximity, the same weight, whichever the case recently defined style;

  • Load Styles with the last load positioning prevail;
  • 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:

Priority:

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

Example CSS3 new pseudo-class:

   
p:first-of-type 选择属于其父元素的首个 <p> 元素的每个 <p> 元素。
p:last-of-type  选择属于其父元素的最后 <p> 元素的每个 <p> 元素。
p:only-of-type  选择属于其父元素唯一的 <p> 元素的每个 <p> 元素。
p:only-child    选择属于其父元素的唯一子元素的每个 <p> 元素。
p:nth-child(2)  选择属于其父元素的第二个子元素的每个 <p> 元素。
:enabled  :disabled 控制表单控件的禁用状态。
:checked        单选框或复选框被选中。

position value, relative and absolute are positioned relative to whom?

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

What's new in CSS3 there?

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 and JSON difference?

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 understanding of the specification?

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.)

Under explain CSS sprites, and how do you use it in a page or website.

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 part

html part

Talk about your understanding of semantic?

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 role? How to distinguish between strict mode and promiscuous mode? What is the significance of them?

Doctype role? Strict mode and mixed mode how to distinguish? They mean?

(1)、<!DOCTYPE> 声明位于文档中的最前面,处于 <html> 标签之前。告知浏览器以何种模式来渲染文档。 

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

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

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

(1), <! DOCTYPE> declaration in the document in the front, in the <html> 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.   

Do you know how many document types 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.

Both HTML and XHTML-- What is the difference

HTML and XHTML-- What is the difference

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

Difference: 
1. All tags must have a corresponding end tag element and attribute names 
2. All tags must be lowercase 
3. All the XML tags must be properly nested 
4. All attributes must be quoted. " "enclosed 
5. Put all the <and & special symbols with the coded representation 
6. assign a value to all of the properties in the comment 7. Do not manipulation "-" 
8. The image must have caption

Common compatibility problems?

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:#00deff\9; /*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](http://www.w3.org/TR/html5/single-page.html)推荐的写法:`<doctype html>`

* 上下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, 

you 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; 

under 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, 

by 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: `<DOCTYPE html>` 

* top and bottom margin overlap problem 

ie 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 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浏览器。具体写法可参照以下

This article is reproduced in: ape 2048 the most complete front-end development Interview Questions and Answers finishing

Guess you like

Origin www.cnblogs.com/10manongit/p/12645325.html