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

資訊專欄INFORMATION COLUMN

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

zlyBear / 3524人閱讀

摘要:最多個和沒有做硬性限制和會清理近期最少使用的,會隨機清理。每個最多只能有條,每個長度不能超過,否則會被截掉。除此之外,擁有等方法,不像需要前端開發(fā)者自己封裝,。控制表單控件的禁用狀態(tài)。

來自Github秋風(fēng)的原文

說說你對閉包的理解 Talk about your understanding of closures

使用閉包主要是為了設(shè)計私有的方法和變量。閉包的優(yōu)點是可以避免全局變量的污染,缺點是閉包會常駐內(nèi)存,會增大內(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.

閉包有三個特性:

Closures have three characteristics:

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

Function

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

The parameters and variables will not be garbage collection mechanism Recycling

請你談?wù)凜ookie的弊端

You talk about the shortcomings of Cookie

cookie雖然在持久保存客戶端數(shù)據(jù)提供了方便,分擔(dān)了服務(wù)器存儲的負(fù)擔(dān),但還是有很多局限性的。
第一:每個特定的域名下最多生成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字節(jié),為了兼容性,一般不能超過4095字節(jié)。

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

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)點:極高的擴展性和可用性 Advantages: high scalability and availability
1.通過良好的編程,控制保存在cookie中的session對象的大小。
2.通過加密和安全傳輸技術(shù)(SSL),減少cookie被破解的可能性。
3.只在cookie中存放不敏感數(shù)據(jù),即使被盜也不會有重大損失。
4.控制cookie的生命期,使之不會永遠(yuǎn)有效。偷盜者很可能拿到一個過期的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:
1.`Cookie`數(shù)量和長度的限制。每個domain最多只能有20條cookie,每個cookie長度不能超過4KB,否則會被截掉。

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

3.有些狀態(tài)不可能保存在客戶端。例如,為了防止重復(fù)提交表單,我們需要在服務(wù)器端保存一個計數(shù)器。如果我們把這個計數(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. 

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

瀏覽器本地存儲

在較高版本的瀏覽器中,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)中的數(shù)據(jù),這些數(shù)據(jù)只有在同一個會話中的頁面才能訪問并且當(dāng)會話結(jié)束后數(shù)據(jù)也隨之銷毀。因此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用于持久化的本地存儲,除非主動刪除數(shù)據(jù),否則數(shù)據(jù)是永遠(yuǎn)不會過期的。

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ū)別是它是為了更大容量存儲設(shè)計的。Cookie的大小是受限的,并且每次你請求一個新的頁面的時候Cookie都會被發(fā)送過去,這樣無形中浪費了帶寬,另外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僅僅是為了在本地“存儲”數(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ù)器里運行),值得一提的是IE總是辦好事,例如IE7、IE6中的userData其實就是javascript本地存儲的解決方案。通過簡單的代碼封裝可以統(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會在一定時間內(nèi)保存在服務(wù)器上。當(dāng)訪問增多,會比較占用你服務(wù)器的性能
     考慮到減輕服務(wù)器性能方面,應(yīng)當(dāng)使用COOKIE。
 4、單個cookie保存的數(shù)據(jù)不能超過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 相關(guān)問題

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

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

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) 頁面被加載的時,link會同時被加載,而@import引用的CSS會等到頁面被加載完再加載;
(3) import只在IE5以上才能識別,而link是HTML標(biāo)簽,無兼容問題; 
(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:共同點:
對內(nèi)聯(lián)元素設(shè)置`float`和`absolute`屬性,可以讓元素脫離文檔流,并且可以設(shè)置其寬高。

B:不同點:
float仍會占據(jù)位置,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屬性主要用來控制元素的盒模型的解析模式。默認(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ī)范對盒模型解析,一旦修改了元素的邊框或內(nèi)距,就會影響元素的盒子尺寸,就不得不重新計算元素的盒子尺寸,從而影響整個頁面的布局。

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 選擇符有哪些?哪些屬性可以繼承?優(yōu)先級算法如何計算? 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) 
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)
      

可繼承的樣式: font-size font-family color, text-indent;

不可繼承的樣式:border padding margin width height ;

優(yōu)先級就近原則,同權(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)先級為:

Priority:

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

CSS3新增偽類舉例:

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

元素的每個

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

元素的每個

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

元素的每個

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

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

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

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

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

relative 
    生成相對定位的元素,相對于其在普通流中的位置進(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實現(xiàn)圓角(border-radius),陰影(box-shadow),
對文字加特效(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相對于XML來講,數(shù)據(jù)的體積小,傳遞的速度更快些。
(2).數(shù)據(jù)交互方面。
JSON與JavaScript的交互更加方便,更容易解析處理,更好的數(shù)據(jù)交互。
(3).數(shù)據(jù)描述方面。
JSON對數(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.
對BFC規(guī)范的理解? BFC norms of understanding?
      BFC,塊級格式化上下文,一個創(chuàng)建了新的BFC的盒子是獨立布局的,盒子里面的子元素的樣式不會影響到外面的元素。在同一個BFC中的兩個毗鄰的塊級盒在垂直方向(和布局方向有關(guān)系)的margin會發(fā)生折疊。
    (W3C CSS 2.1 規(guī)范中的一個概念,它決定了元素如何對其內(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,以及你要如何在頁面或網(wǎng)站中使用它。 Talk about your understanding of the semantic?
CSS Sprites其實就是把網(wǎng)頁中一些背景圖片整合到一張圖片文件中,再利用CSS的“background-image”,“background- repeat”,“background-position”的組合進(jìn)行背景定位,background-position可以用數(shù)字能精確的定位出背景圖片的位置。這樣可以減少很多圖片請求的開銷,因為請求耗時比較長;請求雖然可以并發(fā),但是也有限制,一般瀏覽器都是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,去掉或者丟失樣式的時候能夠讓頁面呈現(xiàn)出清晰的結(jié)構(gòu)
2,有利于SEO:和搜索引擎建立良好溝通,有助于爬蟲抓取更多的有效信息:爬蟲依賴于標(biāo)簽來確定上下文和各個關(guān)鍵字的權(quán)重;
3,方便其他設(shè)備解析(如屏幕閱讀器、盲人閱讀器、移動設(shè)備)以意義的方式來渲染網(wǎng)頁;
4,便于團(tuán)隊開發(fā)和維護(hù),語義化更具可讀性,是下一步吧網(wǎng)頁的重要動向,遵循W3C標(biāo)準(zhǔn)的團(tuán)隊都遵循這個標(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)簽之前。告知瀏覽器以何種模式來渲染文檔。 

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

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

(4)、DOCTYPE不存在或格式不正確會導(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)頁,而 Quirks
 (包容)模式(也就是松散呈現(xiàn)模式或者兼容模式)用于呈現(xiàn)為傳統(tǒng)瀏覽器而設(shè)計的網(wǎng)頁。
 
 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)記都必須要有一個相應(yīng)的結(jié)束標(biāo)記
2.所有標(biāo)簽的元素和屬性的名字都必須使用小寫
3.所有的XML標(biāo)記都必須合理嵌套
4.所有的屬性必須用引號""括起來
5.把所有<和&特殊符號用編碼表示
6.給所有屬性賦一個值
7.不要在注釋內(nèi)容中使“--”
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 
常見兼容性問題?
Common compatibility problems?
* png24位的圖片在iE6瀏覽器上出現(xiàn)背景,解決方案是做成PNG8.也可以引用一段腳本處理.

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

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

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

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

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

* 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游覽器從所有情況中分離出來。 
  接著,再次使用“+”將IE8和IE7、IE6分離開來,這樣IE8已經(jīng)獨立識別。
  
  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下,可以使用獲取常規(guī)屬性的方法來獲取自定義屬性,
   也可以使用getAttribute()獲取自定義屬性;
   Firefox下,只能使用getAttribute()獲取自定義屬性. 
   解決方法:統(tǒng)一通過getAttribute()獲取自定義屬性.

* IE下,event對象有x,y屬性,但是沒有pageX,pageY屬性; 
  Firefox下,event對象有pageX,pageY屬性,但是沒有x,y屬性.

* 解決方法:(條件注釋)缺點是在IE瀏覽器下可能會增加額外的HTTP請求數(shù)。

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

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

* 怪異模式問題:漏寫DTD聲明,F(xiàn)irefox仍然會按照標(biāo)準(zhǔn)模式來解析網(wǎng)頁,但在IE中會觸發(fā)怪異模式。為避免怪異模式給我們帶來不必要的麻煩,最好養(yǎng)成書寫DTD聲明的好習(xí)慣。現(xiàn)在可以使用[html5](http://www.w3.org/TR/html5/single-page.html)推薦的寫法:``

* 上下margin重合問題
ie和ff都存在,相鄰的兩個div的margin-left和margin-right不會重合,但是margin-top和margin-bottom卻會發(fā)生重合。
解決方法,養(yǎng)成良好的代碼編寫習(xí)慣,同時采用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: `` 

* 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
浮動元素脫離文檔流,不占據(jù)空間。浮動元素碰到包含它的邊框或者浮動元素的邊框停留。
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)簽清除浮動。
   這種方法是在所有浮動標(biāo)簽后面添加一個空標(biāo)簽 定義css clear:both. 弊端就是增加了無意義標(biāo)簽。
2.使用overflow。
   給包含浮動元素的父標(biāo)簽添加css屬性 overflow:auto; zoom:1; zoom:1用于兼容IE6。
3.使用after偽對象清除浮動。
   該方法只適用于非IE瀏覽器。具體寫法可參照以下

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://specialneedsforspecialkids.com/yun/78944.html

相關(guān)文章

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

    摘要:最多個和沒有做硬性限制和會清理近期最少使用的,會隨機清理。每個最多只能有條,每個長度不能超過,否則會被截掉。除此之外,擁有等方法,不像需要前端開發(fā)者自己封裝,。控制表單控件的禁用狀態(tài)。 說說你對閉包的理解 Talk about your understanding of closures 使用閉包主要是為了設(shè)計私有的方法和變量。閉包的優(yōu)點是可以避免全局變量的污染,缺點是閉包會常駐內(nèi)存,...

    Cristic 評論0 收藏0
  • 最全前端開發(fā)試問題及答案整理

    摘要:最多個和沒有做硬性限制和會清理近期最少使用的,會隨機清理。每個最多只能有條,每個長度不能超過,否則會被截掉。除此之外,擁有等方法,不像需要前端開發(fā)者自己封裝,。控制表單控件的禁用狀態(tài)。 來自Github秋風(fēng)的原文 說說你對閉包的理解 Talk about your understanding of closures 使用閉包主要是為了設(shè)計私有的方法和變量。閉包的優(yōu)點是可以避免全局變量的...

    NikoManiac 評論0 收藏0
  • 正在暑假中的《課多周刊》(第1期)

    摘要:正在暑假中的課多周刊第期我們的微信公眾號,更多精彩內(nèi)容皆在微信公眾號,歡迎關(guān)注。若有幫助,請把課多周刊推薦給你的朋友,你的支持是我們最大的動力。原理微信熱更新方案漲知識了,熱更新是以后的標(biāo)配。 正在暑假中的《課多周刊》(第1期) 我們的微信公眾號:fed-talk,更多精彩內(nèi)容皆在微信公眾號,歡迎關(guān)注。 若有幫助,請把 課多周刊 推薦給你的朋友,你的支持是我們最大的動力。 遠(yuǎn)上寒山石徑...

    liukai90 評論0 收藏0
  • 正在暑假中的《課多周刊》(第1期)

    摘要:正在暑假中的課多周刊第期我們的微信公眾號,更多精彩內(nèi)容皆在微信公眾號,歡迎關(guān)注。若有幫助,請把課多周刊推薦給你的朋友,你的支持是我們最大的動力。原理微信熱更新方案漲知識了,熱更新是以后的標(biāo)配。 正在暑假中的《課多周刊》(第1期) 我們的微信公眾號:fed-talk,更多精彩內(nèi)容皆在微信公眾號,歡迎關(guān)注。 若有幫助,請把 課多周刊 推薦給你的朋友,你的支持是我們最大的動力。 遠(yuǎn)上寒山石徑...

    yintaolaowanzi 評論0 收藏0

發(fā)表評論

0條評論

最新活動
閱讀需要支付1元查看
<