国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

前端開發(fā)面試問題及答案整理

xbynet / 2467人閱讀

摘要:只在中存放不敏感數(shù)據(jù),即使被盜也不會(huì)有重大損失。每個(gè)最多只能有條,每個(gè)長(zhǎng)度不能超過,否則會(huì)被截掉。除此之外,擁有等方法,不像需要前端開發(fā)者自己封裝,??刂票韱慰丶慕脿顟B(tài)。規(guī)定了三種文檔類型以及。

說(shuō)說(shuō)你對(duì)閉包的理解 Talk about your understanding of closures

使用閉包主要是為了設(shè)計(jì)私有的方法和變量。閉包的優(yōu)點(diǎn)是可以避免全局變量的污染,缺點(diǎn)是閉包會(huì)常駐內(nèi)存,會(huì)增大內(nèi)存使用量,使用不當(dāng)很容易造成內(nèi)存泄露。

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.

閉包有三個(gè)特性:

Closures have three characteristics:

1.函數(shù)嵌套函數(shù)
2.函數(shù)內(nèi)部可以引用外部的參數(shù)和變量
3.參數(shù)和變量不會(huì)被垃圾回收機(jī)制回收

Function

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

The parameters and variables will not be garbage collection mechanism Recycling

請(qǐng)你談?wù)凜ookie的弊端

You talk about the shortcomings of Cookie

cookie雖然在持久保存客戶端數(shù)據(jù)提供了方便,分擔(dān)了服務(wù)器存儲(chǔ)的負(fù)擔(dān),但還是有很多局限性的。
第一:每個(gè)特定的域名下最多生成20個(gè)cookie

1.IE6或更低版本最多20個(gè)cookie
2.IE7和之后的版本最后可以有50個(gè)cookie。
3.Firefox最多50個(gè)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 會(huì)清理近期最少使用的cookieFirefox會(huì)隨機(jī)清理cookie。

cookie的最大大約為4096字節(jié),為了兼容性,一般不能超過4095字節(jié)。

IE 提供了一種存儲(chǔ)可以持久化用戶數(shù)據(jù),叫做userdata,從IE5.0就開始支持。每個(gè)數(shù)據(jù)最多128K,每個(gè)域名下最多1M。這個(gè)持久化數(shù)據(jù)放在緩存中,如果緩存沒有清理,那么會(huì)一直存在。

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.

優(yōu)點(diǎn):極高的擴(kuò)展性和可用性 Advantages: high scalability and availability
1.通過良好的編程,控制保存在cookie中的session對(duì)象的大小。
2.通過加密和安全傳輸技術(shù)(SSL),減少cookie被破解的可能性。
3.只在cookie中存放不敏感數(shù)據(jù),即使被盜也不會(huì)有重大損失。
4.控制cookie的生命期,使之不會(huì)永遠(yuǎn)有效。偷盜者很可能拿到一個(gè)過期的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.

缺點(diǎn): Disadvantages:
1.`Cookie`數(shù)量和長(zhǎng)度的限制。每個(gè)domain最多只能有20條cookie,每個(gè)cookie長(zhǎng)度不能超過4KB,否則會(huì)被截掉。

2.安全性問題。如果cookie被人攔截了,那人就可以取得所有的session信息。即使加密也與事無(wú)補(bǔ),因?yàn)閿r截者并不需要知道cookie的意義,他只要原樣轉(zhuǎn)發(fā)cookie就可以達(dá)到目的了。

3.有些狀態(tài)不可能保存在客戶端。例如,為了防止重復(fù)提交表單,我們需要在服務(wù)器端保存一個(gè)計(jì)數(shù)器。如果我們把這個(gè)計(jì)數(shù)器保存在客戶端,那么它起不到任何作用。

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

瀏覽器本地存儲(chǔ)

在較高版本的瀏覽器中,js提供了sessionStorageglobalStorage。在HTML5中提供了localStorage來(lái)取代globalStorage。

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

html5中的Web Storage包括了兩種存儲(chǔ)方式:sessionStoragelocalStorage。

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

sessionStorage用于本地存儲(chǔ)一個(gè)會(huì)話(session)中的數(shù)據(jù),這些數(shù)據(jù)只有在同一個(gè)會(huì)話中的頁(yè)面才能訪問并且當(dāng)會(huì)話結(jié)束后數(shù)據(jù)也隨之銷毀。因此sessionStorage不是一種持久化的本地存儲(chǔ),僅僅是會(huì)話級(jí)別的存儲(chǔ)。

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用于持久化的本地存儲(chǔ),除非主動(dòng)刪除數(shù)據(jù),否則數(shù)據(jù)是永遠(yuǎn)不會(huì)過期的。

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

web storage和cookie的區(qū)別 the difference between web storage and a cookie

Web Storage的概念和cookie相似,區(qū)別是它是為了更大容量存儲(chǔ)設(shè)計(jì)的。Cookie的大小是受限的,并且每次你請(qǐng)求一個(gè)新的頁(yè)面的時(shí)候Cookie都會(huì)被發(fā)送過去,這樣無(wú)形中浪費(fèi)了帶寬,另外cookie還需要指定作用域,不可以跨域調(diào)用。

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需要前端開發(fā)者自己封裝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的作用是與服務(wù)器進(jìn)行交互,作為HTTP規(guī)范的一部分而存在 ,而Web Storage僅僅是為了在本地“存儲(chǔ)”數(shù)據(jù)而生

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及以下不支持外,其他標(biāo)準(zhǔn)瀏覽器都完全支持(ie及FF需在web服務(wù)器里運(yùn)行),值得一提的是IE總是辦好事,例如IE7、IE6中的userData其實(shí)就是javascript本地存儲(chǔ)的解決方案。通過簡(jiǎn)單的代碼封裝可以統(tǒng)一到所有的瀏覽器都支持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 的區(qū)別: cookie and session distinction:
 1、cookie數(shù)據(jù)存放在客戶的瀏覽器上,session數(shù)據(jù)放在服務(wù)器上。
 2、cookie不是很安全,別人可以分析存放在本地的COOKIE并進(jìn)行COOKIE欺騙
    考慮到安全應(yīng)當(dāng)使用session。
 3、session會(huì)在一定時(shí)間內(nèi)保存在服務(wù)器上。當(dāng)訪問增多,會(huì)比較占用你服務(wù)器的性能
     考慮到減輕服務(wù)器性能方面,應(yīng)當(dāng)使用COOKIE。
 4、單個(gè)cookie保存的數(shù)據(jù)不能超過4K,很多瀏覽器都限制一個(gè)站點(diǎn)最多保存20個(gè)cookie。
 5、所以個(gè)人建議:
    將登陸信息等重要信息存放為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 相關(guān)問題

CSS-related issues display:none和visibility:hidden的區(qū)別? display: none and visibility: hidden difference?
display:none  隱藏對(duì)應(yīng)的元素,在文檔布局中不再給它分配空間,它各邊的元素會(huì)合攏,
就當(dāng)他從來(lái)不存在。

visibility:hidden  隱藏對(duì)應(yīng)的元素,但是在文檔布局中仍保留原來(lái)的空間。

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 的區(qū)別是? The difference in the link andimport CSS is?
(1) link屬于HTML標(biāo)簽,而@import是CSS提供的; 
(2) 頁(yè)面被加載的時(shí),link會(huì)同時(shí)被加載,而@import引用的CSS會(huì)等到頁(yè)面被加載完再加載;
(3) import只在IE5以上才能識(shí)別,而link是HTML標(biāo)簽,無(wú)兼容問題; 
(4) link方式的樣式的權(quán)重 高于@import的權(quán)重.

(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:共同點(diǎn):
對(duì)內(nèi)聯(lián)元素設(shè)置`float`和`absolute`屬性,可以讓元素脫離文檔流,并且可以設(shè)置其寬高。

B:不同點(diǎn):
float仍會(huì)占據(jù)位置,position會(huì)覆蓋文檔流中的其他元素。

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屬性主要用來(lái)控制元素的盒模型的解析模式。默認(rèn)值是content-box。
box-sizing property is primarily used to control element analytical model box model. The default value is content-Box.

content-box:讓元素維持W3C的標(biāo)準(zhǔn)盒模型。元素的寬度/高度由border + padding + content的寬度/高度決定,設(shè)置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傳統(tǒng)盒模型(IE6以下版本和IE6~7的怪異模式)。設(shè)置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

標(biāo)準(zhǔn)瀏覽器下,按照W3C規(guī)范對(duì)盒模型解析,一旦修改了元素的邊框或內(nèi)距,就會(huì)影響元素的盒子尺寸,就不得不重新計(jì)算元素的盒子尺寸,從而影響整個(gè)頁(yè)面的布局。

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 選擇符有哪些?哪些屬性可以繼承??jī)?yōu)先級(jí)算法如何計(jì)算? 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.標(biāo)簽選擇器(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 ;

優(yōu)先級(jí)就近原則,同權(quán)重情況下樣式定義最近者為準(zhǔn);

載入樣式以最后載入的定位為準(zhǔn);

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;

優(yōu)先級(jí)為:

Priority:

  
  
!important >  id > class > tag  
  
important 比 內(nèi)聯(lián)優(yōu)先級(jí)高,但內(nèi)聯(lián)比 id 要高

CSS3新增偽類舉例:

   
p:first-of-type 選擇屬于其父元素的首個(gè) 

元素的每個(gè)

元素。 p:last-of-type 選擇屬于其父元素的最后

元素的每個(gè)

元素。 p:only-of-type 選擇屬于其父元素唯一的

元素的每個(gè)

元素。 p:only-child 選擇屬于其父元素的唯一子元素的每個(gè)

元素。 p:nth-child(2) 選擇屬于其父元素的第二個(gè)子元素的每個(gè)

元素。 :enabled :disabled 控制表單控件的禁用狀態(tài)。 :checked 單選框或復(fù)選框被選中。

position的值, relative和absolute分別是相對(duì)于誰(shuí)進(jìn)行定位的? position values, relative and absolute are positioned with respect to whom?
absolute 
        生成絕對(duì)定位的元素, 相對(duì)于最近一級(jí)的 定位不是 static 的父元素來(lái)進(jìn)行定位。

fixed (老IE不支持)
    生成絕對(duì)定位的元素,相對(duì)于瀏覽器窗口進(jìn)行定位。 

relative 
    生成相對(duì)定位的元素,相對(duì)于其在普通流中的位置進(jìn)行定位。 

static  默認(rèn)值。沒有定位,元素出現(xiàn)在正常的流中

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實(shí)現(xiàn)圓角(border-radius),陰影(box-shadow),
對(duì)文字加特效(text-shadow、),線性漸變(gradient),旋轉(zhuǎn)(transform)
transform:rotate(9deg) scale(0.85,0.90) translate(0px,-30px) skew(-9deg,0deg);//旋轉(zhuǎn),縮放,定位,傾斜
增加了更多的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的區(qū)別? XML and JSON difference?
(1).數(shù)據(jù)體積方面。
JSON相對(duì)于XML來(lái)講,數(shù)據(jù)的體積小,傳遞的速度更快些。
(2).數(shù)據(jù)交互方面。
JSON與JavaScript的交互更加方便,更容易解析處理,更好的數(shù)據(jù)交互。
(3).數(shù)據(jù)描述方面。
JSON對(duì)數(shù)據(jù)的描述性比XML較差。
(4).傳輸速度方面。
JSON的速度要遠(yuǎn)遠(yuǎn)快于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.
對(duì)BFC規(guī)范的理解? BFC norms of understanding?
      BFC,塊級(jí)格式化上下文,一個(gè)創(chuàng)建了新的BFC的盒子是獨(dú)立布局的,盒子里面的子元素的樣式不會(huì)影響到外面的元素。在同一個(gè)BFC中的兩個(gè)毗鄰的塊級(jí)盒在垂直方向(和布局方向有關(guān)系)的margin會(huì)發(fā)生折疊。
    (W3C CSS 2.1 規(guī)范中的一個(gè)概念,它決定了元素如何對(duì)其內(nèi)容進(jìn)行布局,以及與其他元素的關(guān)系和相互作用。)
    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,以及你要如何在頁(yè)面或網(wǎng)站中使用它。 Talk about your understanding of the semantic?
CSS Sprites其實(shí)就是把網(wǎng)頁(yè)中一些背景圖片整合到一張圖片文件中,再利用CSS的“background-image”,“background- repeat”,“background-position”的組合進(jìn)行背景定位,background-position可以用數(shù)字能精確的定位出背景圖片的位置。這樣可以減少很多圖片請(qǐng)求的開銷,因?yàn)檎?qǐng)求耗時(shí)比較長(zhǎng);請(qǐng)求雖然可以并發(fā),但是也有限制,一般瀏覽器都是6個(gè)。對(duì)于未來(lái)而言,就不需要這樣做了,因?yàn)橛辛薫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 說(shuō)說(shuō)你對(duì)語(yǔ)義化的理解? Talk about your understanding of the semantic?
1,去掉或者丟失樣式的時(shí)候能夠讓頁(yè)面呈現(xiàn)出清晰的結(jié)構(gòu)
2,有利于SEO:和搜索引擎建立良好溝通,有助于爬蟲抓取更多的有效信息:爬蟲依賴于標(biāo)簽來(lái)確定上下文和各個(gè)關(guān)鍵字的權(quán)重;
3,方便其他設(shè)備解析(如屏幕閱讀器、盲人閱讀器、移動(dòng)設(shè)備)以意義的方式來(lái)渲染網(wǎng)頁(yè);
4,便于團(tuán)隊(duì)開發(fā)和維護(hù),語(yǔ)義化更具可讀性,是下一步吧網(wǎng)頁(yè)的重要?jiǎng)酉颍裱璚3C標(biāo)準(zhǔn)的團(tuán)隊(duì)都遵循這個(gè)標(biāo)準(zhǔn),可以減少差異化。

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作用? 嚴(yán)格模式與混雜模式如何區(qū)分?它們有何意義? Doctype role? Strict mode and mixed mode how to distinguish? They mean?
(1)、 聲明位于文檔中的最前面,處于  標(biāo)簽之前。告知瀏覽器以何種模式來(lái)渲染文檔。 

(2)、嚴(yán)格模式的排版和 JS 運(yùn)作模式是  以該瀏覽器支持的最高標(biāo)準(zhǔn)運(yùn)行。

(3)、在混雜模式中,頁(yè)面以寬松的向后兼容的方式顯示。模擬老式瀏覽器的行為以防止站點(diǎn)無(wú)法工作。

(4)、DOCTYPE不存在或格式不正確會(huì)導(dǎo)致文檔以混雜模式呈現(xiàn)。  

(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?
 該標(biāo)簽可聲明三種 DTD 類型,分別表示嚴(yán)格版本、過渡版本以及基于框架的 HTML 文檔。
 HTML 4.01 規(guī)定了三種文檔類型:Strict、Transitional 以及 Frameset。
 XHTML 1.0 規(guī)定了三種 XML 文檔類型:Strict、Transitional 以及 Frameset。
Standards (標(biāo)準(zhǔn))模式(也就是嚴(yán)格呈現(xiàn)模式)用于呈現(xiàn)遵循最新標(biāo)準(zhǔn)的網(wǎng)頁(yè),而 Quirks
 (包容)模式(也就是松散呈現(xiàn)模式或者兼容模式)用于呈現(xiàn)為傳統(tǒng)瀏覽器而設(shè)計(jì)的網(wǎng)頁(yè)。
 
 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——二者有什么區(qū)別 HTML and XHTML-- What is the difference
區(qū)別:
1.所有的標(biāo)記都必須要有一個(gè)相應(yīng)的結(jié)束標(biāo)記
2.所有標(biāo)簽的元素和屬性的名字都必須使用小寫
3.所有的XML標(biāo)記都必須合理嵌套
4.所有的屬性必須用引號(hào)""括起來(lái)
5.把所有<和&特殊符號(hào)用編碼表示
6.給所有屬性賦一個(gè)值
7.不要在注釋內(nèi)容中使“--”
8.圖片必須有說(shuō)明文字

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瀏覽器上出現(xiàn)背景,解決方案是做成PNG8.也可以引用一段腳本處理.

瀏覽器默認(rèn)的margin和padding不同。解決方案是加一個(gè)全局的*{margin:0;padding:0;}來(lái)統(tǒng)一。

IE6雙邊距bug:塊屬性標(biāo)簽float后,又有橫行的margin情況下,在ie6顯示margin比設(shè)置的大。

浮動(dòng)ie產(chǎn)生的雙倍距離(IE6雙邊距問題:在IE6下,如果對(duì)元素設(shè)置了浮動(dòng),同時(shí)又設(shè)置了margin-left或margin-right,margin值會(huì)加倍。)
#box{ float:left; width:10px; margin:0 0 0 100px;}

這種情況之下IE會(huì)產(chǎn)生20px的距離,解決方案是在float的標(biāo)簽樣式控制中加入 ——_display:inline;將其轉(zhuǎn)化為行內(nèi)屬性。(_這個(gè)符號(hào)只有ie6會(huì)識(shí)別)

漸進(jìn)識(shí)別的方式,從總體中逐漸排除局部。

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”這一標(biāo)記,將IE游覽器從所有情況中分離出來(lái)。
接著,再次使用“+”將IE8和IE7、IE6分離開來(lái),這樣IE8已經(jīng)獨(dú)立識(shí)別。

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;/*所有識(shí)別*/
  .background-color:#00deff9; /*IE6、7、8識(shí)別*/
  +background-color:#a200ff;/*IE6、7識(shí)別*/
  _background-color:#1e0bd1;/*IE6識(shí)別*/ 
  } 

IE下,可以使用獲取常規(guī)屬性的方法來(lái)獲取自定義屬性,
也可以使用getAttribute()獲取自定義屬性;
Firefox下,只能使用getAttribute()獲取自定義屬性.
解決方法:統(tǒng)一通過getAttribute()獲取自定義屬性.

IE下,event對(duì)象有x,y屬性,但是沒有pageX,pageY屬性;
Firefox下,event對(duì)象有pageX,pageY屬性,但是沒有x,y屬性.

解決方法:(條件注釋)缺點(diǎn)是在IE瀏覽器下可能會(huì)增加額外的HTTP請(qǐng)求數(shù)。

Chrome 中文界面下默認(rèn)會(huì)將小于 12px 的文本強(qiáng)制按照 12px 顯示,
可通過加入 CSS 屬性 -webkit-text-size-adjust: none; 解決.

超鏈接訪問過后hover樣式就不出現(xiàn)了 被點(diǎn)擊訪問過的超鏈接樣式不在具有hover和active了解決方法是改變CSS屬性的排列順序:
L-V-H-A : a:link {} a:visited {} a:hover {} a:active {}

怪異模式問題:漏寫DTD聲明,F(xiàn)irefox仍然會(huì)按照標(biāo)準(zhǔn)模式來(lái)解析網(wǎng)頁(yè),但在IE中會(huì)觸發(fā)怪異模式。為避免怪異模式給我們帶來(lái)不必要的麻煩,最好養(yǎng)成書寫DTD聲明的好習(xí)慣。現(xiàn)在可以使用html5推薦的寫法:

上下margin重合問題
ie和ff都存在,相鄰的兩個(gè)div的margin-left和margin-right不會(huì)重合,但是margin-top和margin-bottom卻會(huì)發(fā)生重合。

解決方法,養(yǎng)成良好的代碼編寫習(xí)慣,同時(shí)采用margin-top或者同時(shí)采用margin-bottom。

ie6對(duì)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)

解釋下浮動(dòng)和它的工作原理?清除浮動(dòng)的技巧 Floating and explain how it works? Clear float tips
浮動(dòng)元素脫離文檔流,不占據(jù)空間。浮動(dòng)元素碰到包含它的邊框或者浮動(dòng)元素的邊框停留。
Floating elements from the document flow, does not occupy space. Floats across the border to stay its borders contain or floating elements. 

1.使用空標(biāo)簽清除浮動(dòng)。
   這種方法是在所有浮動(dòng)標(biāo)簽后面添加一個(gè)空標(biāo)簽 定義css clear:both. 弊端就是增加了無(wú)意義標(biāo)簽。
2.使用overflow。
   給包含浮動(dòng)元素的父標(biāo)簽添加css屬性 overflow:auto; zoom:1; zoom:1用于兼容IE6。
3.使用after偽對(duì)象清除浮動(dòng)。
   該方法只適用于非IE瀏覽器。具體寫法可參照以下示例。使用中需注意以下幾點(diǎn)。一、該方法中必須為需要清除浮動(dòng)元素的偽對(duì)象中設(shè)置 height:0,否則該元素會(huì)比實(shí)際高出若干像素;
   

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;

浮動(dòng)元素引起的問題和解決辦法? Problems caused by floating elements and solutions?
浮動(dòng)元素引起的問題:

Problems caused by the floating elements: 

(1)父元素的高度無(wú)法被撐開,影響與父元素同級(jí)的元素
(2)與浮動(dòng)元素同級(jí)的非浮動(dòng)元素(內(nèi)聯(lián)元素)會(huì)跟隨其后
(3)若非第一個(gè)元素浮動(dòng),則該元素之前的元素也需要浮動(dòng),否則會(huì)影響頁(yè)面顯示的結(jié)構(gòu)

(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;屬性來(lái)清除元素的浮動(dòng)可解決2、3問題,對(duì)于問題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 */

清除浮動(dòng)的幾種方法:

1,額外標(biāo)簽法,
(缺點(diǎn):不過這個(gè)辦法會(huì)增加額外的標(biāo)簽使HTML結(jié)構(gòu)看起來(lái)不夠簡(jiǎn)潔。) 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,浮動(dòng)外部元素 4,設(shè)置`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以下瀏覽器的盒模型中定義的元素的寬高不包括內(nèi)邊距和邊框

The following box model IE8 browser"s width and height defined elements does not include padding and border
DOM操作——怎樣添加、移除、移動(dòng)、復(fù)制、創(chuàng)建和查找節(jié)點(diǎn)。 DOM manipulation - how to add, remove, move, copy, create, and find nodes.
(1)創(chuàng)建新節(jié)點(diǎn)

      createDocumentFragment()    //創(chuàng)建一個(gè)DOM片段

      createElement()   //創(chuàng)建一個(gè)具體的元素

      createTextNode()   //創(chuàng)建一個(gè)文本節(jié)點(diǎn)

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

      appendChild()

      removeChild()

      replaceChild()

      insertBefore() //在已有的子節(jié)點(diǎn)前插入一個(gè)新的子節(jié)點(diǎn)

(3)查找

      getElementsByTagName()    //通過標(biāo)簽名稱

      getElementsByName()    //通過元素的Name屬性的值(IE容錯(cuò)能力較強(qiáng),會(huì)得到一個(gè)數(shù)組,其中包括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新標(biāo)簽的瀏覽器兼容問題?如何區(qū)分 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 現(xiàn)在已經(jīng)不是 SGML 的子集,主要是關(guān)于圖像,位置,存儲(chǔ),多任務(wù)等功能的增加。

拖拽釋放(Drag and drop) API
語(yǔ)義化更好的內(nèi)容標(biāo)簽(header,nav,footer,aside,article,section)
音頻、視頻API(audio,video)
畫布(Canvas) API
地理(Geolocation) API
本地離線存儲(chǔ) localStorage 長(zhǎng)期存儲(chǔ)數(shù)據(jù),瀏覽器關(guān)閉后數(shù)據(jù)不丟失;
sessionStorage 的數(shù)據(jù)在瀏覽器關(guān)閉后自動(dòng)刪除

表單控件,calendar、date、time、email、url、search
新的技術(shù)webworker, websocket, Geolocation

移除的元素

純表現(xiàn)的元素:basefont,big,center,font, s,strike,tt,u;

對(duì)可用性產(chǎn)生負(fù)面影響的元素:frame,frameset,noframes;

支持HTML5新標(biāo)簽:

IE8/IE7/IE6支持通過document.createElement方法產(chǎn)生的標(biāo)簽,
可以利用這一特性讓這些瀏覽器支持HTML5新標(biāo)簽,

瀏覽器支持新標(biāo)簽后,還需要添加標(biāo)簽?zāi)J(rèn)的樣式:

當(dāng)然最好的方式是直接使用成熟的框架、使用最多的是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

如何區(qū)分: DOCTYPE聲明新增的結(jié)構(gòu)元素功能元素

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

iframe的優(yōu)缺點(diǎn)?
1.`