css bug 集2
生活随笔
收集整理的這篇文章主要介紹了
css bug 集2
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
| Hacking Rules:property:all-ie\9; property:gte-ie8\0;*property:lte-ie7; +property:ie7; _property:ie6; | ||||
| 1 | input[button | submit] 不能用 margin:0 auto; 居中 | IE8 | bug?|?fixed | 為input添加width |
| 2 | body{overflow:hidden;}沒有去掉滾動條 | IE6/7 | bug?|?fixed | 設置html{overflow:hidden;} |
| 3 | hasLayout的標簽擁有高度 | IE6/7 | bug?|?fixed | *height:0; _overflow:hidden; |
| 4 | form>[hasLayout]元素有margin-left時,子元素中的[input | textarea] 出現(xiàn)2×margin-left | IE6/7 | bug?|?fixed | form > [hasLayout 元素]{margin-left:寬度;} form div{*margin-left:寬度÷2;} |
| 5 | 當border-width有1條<邊3條時被設置成dotted時,1px的邊dotted顯示成dashed | IE7 | bug?|?fixed | 不在同一個元素上使用不同寬度的 dotted |
| 6 | 當子元素有position:relative的時候,父元素設置overflow:[hidden|auto]相當于給子元素設置了position:visible; | IE6/7 | bug?|?fixed | 給父元素設置position:relative; |
| 7 | :hover偽類不能改變有position:absolute的子級元素的left/top值 | IE7 | bug?|?fixed | 把top/left的值設置成除0%外的所有百分值;或添加一個margin-[所有方向]除0外的所有值,包括0% |
| 8 | :focus + selector {} 選擇器失效 | IE8 | bug?|?fixed | 在失效選擇器后面添加一個空選擇器, :focus{} |
| 9 | 列表中混亂的浮動:在list中浮動圖片時,圖片出現(xiàn)溢出正常位置;或沒有l(wèi)ist-style | IE8 | bug?|?fixed | 用背景圖片替換list-style |
| 10 | th 不會自動繼承上級元素的 text-align | IE8 | bug?|?fixed | 給th添加text-align:inherit; |
| 11 | 樣式(包括link/style/@import(link)) 最多允許個為是:32 | IE6-8 | ─ 常識 | 99.99%的情況下,不會遇到 |
| 12 | :hover 時若background-color為#fff, 失效 | IE7 | bug?|?fixed | 把background-color改成background?;蛘?#xff0c;非#fff || #ffffff |
| 13 | 忽略’>’后有注釋的選擇器:selector> /**/ selector{} | IE7 | bug?|?fixed | 官方DEMO有誤 |
| 14 | * html | IE6 | ─ HACK | 只對IE6有效 |
| 15 | PNG圖片中的顏色和背景顏色的值相同,但顯示不同 | IE6-7 | bug?|?fixed | 利用?pngcrush?去除圖片中的 Gamma profiles |
| 16 | margin:0 auto; 不能讓block元素水平居中 | IE6-8 | bug?|?fixed | 給block元素添加一個width |
| 17 | 使用偽類 :first-line | :first-letter, 屬性的值中出現(xiàn)!important 會使屬性失效 | IE8 | bug?|?fixed | !important is evil, don’t use it anymore |
| 18 | :first-letter 失效 | IE6 | bug?|?fixed | 把 :first-letter 移到離{}最近的地方,如 h1, p:first-letter{},而非 p:first-letter h1{} |
| 19 | Position:absolute元素中,a display:block, 在非:hover時只有文本可點擊 | IE6/7 | bug?|?fixed | 給a添加background, 如果背景透明,使用background:url(‘任何頁面中已經(jīng)緩存的文件鏈接’),不推薦background:url(#)[官方的解決方法],因為會增加一下HTTP請求 |
| 20 | float列表元素不水平對齊:li不設置float,a設置display:block;float:[方向],li不水平對齊 | IE6/7 | bug?|?fixed | 給li設置display:inline 或 float:[方向] |
| 21 | dt, dd, li 背景失效 | IE6 | bug?|?fixed | dt, dd, li{position:relative;} |
| 22 | <noscript />元素的樣式在啟用javascript的情況下顯示了樣式 | IE6-8 | bug?|?fixed | 利用js給<noscript />添加display:none; |
| 23 | 使用filter處理的透明背景圖片的透明部分不可點 | IE6-8 | bug?|?fixed | 把background:none變成background:url(‘鏈接’),鏈接到本身和圖片之外的任何文件 |
| 24 | li內(nèi)元素偏離 baseline 向下拉 | IE8 | bug?|?fixed | 給li設置display:inline 或 float:[方向] |
| 25 | 列表中l(wèi)i的list-style不顯示 | IE6/7 | bug?|?fixed | 給li添加margin-left,留空間來顯示(不要加在ul上) |
| 26 | 圖片不能垂直居中 | IE6/7 | bug/fixed | 添加一個空標簽,并賦給”Layout”, 比如display:inline-block; |
| 27 | 不能自定義指針樣式 | IE6-8 | bug?|?fixed | 給指針文件設置絕對路徑 |
| 28 | 背景溢出,拖動滾動條后顯示正常 | IE6 | bug?|?fixed | 給父元素添加overflow:hidden防止溢出,并賦予hasLayout,如果添加_zoom:1; |
| 29 | 高度超過height定義的高 | IE6 | bug/fixed | 添加_overflow:hidden;(推薦)或者_font-size:0; |
| 30 | 寬度超過width定義的寬 | IE6 | bug/fixed | 添加_overflow:hidden; |
| 31 | 雙倍邊距 | IE6 | ─ 常識 | 添加display:inline到float元素中 |
| 32 | margin負值隱藏:hasLayout的父元素內(nèi)的非hasLayout元素,使用負邊距時,超出父元素部分不可見 | IE6/7 | bug/fixed | 去掉父元素的hasLayout;或者賦hasLayout給子元素,并添加position:relative; |
| 33 | 給兩個浮動元素的某中一個的文字設定為斜體,另一個元素下拉在有斜體文字元素的下面 | IE6 | bug/fixed | 給有斜體文字的元素添加overflow:hidden; |
| 35 | 3px 間隔:在float元素后的元素,會有3px間隔 | IE6 | bug/fixed | 因為是確切的3px,所以,用“暴力破解”吧,比如_margin-left:-3px; |
| 35 | text-align 影響塊級元素 | IE6/7 | bug/fixed | 整理你的float;或者分開設置text-align |
轉載于:https://www.cnblogs.com/haohaoday/p/3673040.html
總結
以上是生活随笔為你收集整理的css bug 集2的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: OpenCV+QT5在Window下的环
- 下一篇: 点云数据集汇总整理(匠心之作,附官方下载