常見的瀏覽器核心引擎以及特定應用:
<span class="pun"><span class="pln"><pre class="best-text mb-10"> 如果只让ie6看见用 *html .head{color:#000;}
如果只让ie7看见用 *+html .head{color:#000;}
如果只让ff看见用: root body .head{color:#000;}
如果只让ff、IE8看见用 html>/**/body .head{color:#000;}
如果只是不让ie6看见用 html>body .head{color:#000;} 即对IE 6无效
如果只是不让ff、IE8看见用 *body .head{color:#000;} 即对ff、IE8无效</pre><span class="pun"></span></span></span>
.
<span class="pun"><span class="pln"><span class="pun"><span class="pln"><span class="pun"></span></span>*</span>position</span>:</span>relative
;
<span class="pun"><span class="pln"><span class="pun"><span class="pln"><span class="pun"><span class="pln"><span class="pun">#-<span class="lit">moz<span class="pun">-</span>background</span>-</span>size</span>:</span>50</span>%;</span></span></span>
<span class="pun"><span class="pln"><span class="pun"><span class="pln"><span class="pun"><span class="pln"><span class="pun">-<span class="pln">ms<span class="pun">-<span class="pln">content<span class="pun">-<span class="lit">zoom<span class="pun">-</span>limit</span>-</span> max</span>:</span>50</span>%;</span></span></span></span></span></span></span>
<span class="pun"><span class="pln"><span class="pun"><span class="pln"><span class="pun"><span class="pln"><span class="pun">-<span class="lit">o<span class="lit">-<span class="lit">box<span class="com">-</span>shadow</span>:</span>5px</span>10px</span>20px</span>#f0f;</span></span></span></span></span>
<span class="pun"><span class="pln"><span class="pun"></span></span> </span>
}<span class="pln"><span class="pun"><span class="pln"><span class="pun"><span class="pln"><span class="pun">.</span>div2</span>{</span></span></span></span>
position
:
<br/>
一個高30px的div,預設顯示左上角,如果想垂直居中對其可以加個line-height:30px;樣式。如果你想讓他居下方則修改line-height
數值越大越下,為了防止撐破,還需要再給一個樣式overflow:hidden;
#區塊級物件設定三個樣式解決瀏覽器預設值:寬高overfl
LI中內容超過長度後以省略號顯示的技巧
此技巧適用與IE與OP瀏覽器
li {width:200px;
white-space:nowrap;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
overflow: hidden;
}
為什麼web標準中IE無法設定捲軸顏色了
解決方法是將body換成html
html {
scrollbar-face-color:#f6f6f6;
scrollbar- highlight-color:#fff;
scrollbar-shadow-color:#eeeeee;
scrollbar-3dlight-color:#eeeeee;
scrollbar-arrow-color:#000;
scrollbar-track- color:#fff;
scrollbar-darkshadow-color:#fff;
#}
為什麼無法定義1px左右高度的容器
# IE6下這個問題是因為預設的行高造成的,解決的技巧也有很多,例如:overflow:hidden zoom:0.08 line-height:1px
body,div,dl,dt,dd,ol,h1,h2,h3,h4,h5,h6,form,input,p,th,td{margin :0;padding:0;}
img{border:0px;}
ul {margin:0px;padding:0px;} /
ul li {list-style:none;}
/* Clear Fix */
.clearfix:after {
content:」.」;
display:block;
height:0;
clear:both;
visibility:hidden;
##}
.clearfix {
#display :inline-block;
}
/* Hide from IE Mac */
.clearfix {display:block;}
/* End hide from IE Mac */
/* end of clearfix */
或這樣設定:.hackbox{ display:table; //將物件作為區塊元素級的表格顯示}
太多了參考:
以上是css相容性寫法的實例講解的詳細內容。更多資訊請關注PHP中文網其他相關文章!