<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    秋風(fēng)的蕭瑟 又見(jiàn)湖邊木葉飛

    歡迎來(lái)到梁良 | LonBlog,這里記錄下了我生活點(diǎn)點(diǎn)滴滴。

    web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全 讓FireFox與IE兼容

     web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全 讓FireFox與IE兼容
    1.超鏈接訪問(wèn)過(guò)后hover樣式就不出現(xiàn)的問(wèn)題
    被點(diǎn)擊訪問(wèn)過(guò)的超鏈接樣式不在具有hover和active了,很多人應(yīng)該都遇到過(guò)這個(gè)問(wèn)題,解決方法是改變CSS屬性的排列順序: L-V-H-A
    Code: 

    1. <style type="text/css">   
    2. <!--    
    3. a:link {}   
    4. a:visited {}   
    5. a:hover {}   
    6. a:active {}   
    7. -->   
    8. </style>  
    Java代碼
    1. <style type="text/css">  
    2. <!--   
    3. a:link {}  
    4. a:visited {}  
    5. a:hover {}  
    6. a:active {}  
    7. -->  
    8. </style>  


    2.FireFox下如何使連續(xù)長(zhǎng)字段自動(dòng)換行
    眾所周知IE中直接使用 word-wrap:break-word 就可以了, FF中我們使用JS插入的方法來(lái)解決
    Code: 

    1. <style type="text/css">   
    2. <!--    
    3. div {   
    4.     width:300px;   
    5.     word-wrap:break-word;   
    6.     border:1px solid red;   
    7. }   
    8. -->   
    9. </style>   
    10. <div id="ff">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   
    11. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   
    12. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   
    13. aaaaaaaaaaaaaaaaaaaaaaaaaaa</div>  
    Java代碼
    1. <style type="text/css">  
    2. <!--   
    3. div {  
    4.     width:300px;  
    5.     word-wrap:break-word;  
    6.     border:1px solid red;  
    7. }  
    8. -->  
    9. </style>  
    10. <div id="ff">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  
    11. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  
    12. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa  
    13. aaaaaaaaaaaaaaaaaaaaaaaaaaa</div>  

    Js代碼
    1. <scrīpt type="text/javascrīpt">   
    2. /* <![CDATA[ */  
    3. function toBreakWord(el, intLen){   
    4.     var ōbj=document.getElementById(el);   
    5.     var strContent=obj.innerHTML;     
    6.     var strTemp="";   
    7.     while(strContent.length>intLen){   
    8.         strTemp+=strContent.substr(0,intLen)+"   
    9. ";     
    10.         strContent=strContent.substr(intLen,strContent.length);     
    11.     }   
    12.     strTemp+="   
    13. "+strContent;   
    14.     obj.innerHTML=strTemp;   
    15. }   
    16. if(document.getElementById  &&  !document.all)  toBreakWord("ff"37);   
    17. /* ]]> */  
    18. </script>  
    Java代碼
    1. <scrīpt type="text/javascrīpt">  
    2. /* <![CDATA[ */  
    3. function toBreakWord(el, intLen){  
    4.     var ōbj=document.getElementById(el);  
    5.     var strContent=obj.innerHTML;    
    6.     var strTemp="";  
    7.     while(strContent.length>intLen){  
    8.         strTemp+=strContent.substr(0,intLen)+"  
    9. ";    
    10.         strContent=strContent.substr(intLen,strContent.length);    
    11.     }  
    12.     strTemp+="  
    13. "+strContent;  
    14.     obj.innerHTML=strTemp;  
    15. }  
    16. if(document.getElementById  &&  !document.all)  toBreakWord("ff"37);  
    17. /* ]]> */  
    18. </script>  


    3.ff下為什么父容器的高度不能自適應(yīng)
    在子容器加了浮動(dòng)屬性后,該容器將不能自動(dòng)撐開(kāi),解決方法是在標(biāo)簽結(jié)束后加上一個(gè)清除浮動(dòng)的元素。
    Code: 

    1. clear: both;  
    Java代碼
    1. clear: both;  


    4.IE6 的雙倍邊距BUG
    浮動(dòng)后本來(lái)外邊距10px,但I(xiàn)E解釋為20px,解決辦法是加上
    Code: 

    1. display: inline  
    Java代碼
    1. display: inline  


    5. IE6下絕對(duì)定位的容器內(nèi)文本無(wú)法正常選擇的問(wèn)題
    此問(wèn)題在IE6、7中存在,解決問(wèn)題的辦法是讓IE進(jìn)入到qurks mode。關(guān)于qurks mode的相關(guān)知識(shí),請(qǐng)參考:
    [url]http://www.microsoft.com/china/msdn/library/webservices/asp.net/
    ASPNETusStan.mspx?mfr=true[/url]

    6. IE6下為什么圖片下方有空隙產(chǎn)生
    解決這個(gè)BUG的方法也有很多,可以是改變html的排版,或者設(shè)置img 為display:block 或者設(shè)置vertical-align 屬性為vertical-align:top | bottom |middle |text-bottom
    都可以解決.

    7. IE6下兩個(gè)層中間怎么有間隙
    這個(gè)IE的3PX BUG也是經(jīng)常出現(xiàn)的,解決的辦法是給.right也同樣浮動(dòng) float:left 或者相對(duì)IE6定義.left margin-right:-3px;

    8. list-style-image無(wú)法準(zhǔn)確定位的問(wèn)題
    list-style-image的定位問(wèn)題也是經(jīng)常有人問(wèn)的,解決的辦法一般是用li的背景模擬,這里采用相對(duì)定位的方法也可以解決。

    9. LI中內(nèi)容超過(guò)長(zhǎng)度后以省略號(hào)顯示的方法
    此方法適用與IE與OP瀏覽器
    Code: 

    1. <style type="text/css">   
    2. <! --    
    3. li {   
    4.     width: 200px;   
    5.     white-space:nowrap;   
    6.     text-overflow:ellipsis;    
    7.     -o-text-overflow:ellipsis;    
    8.     overflow: hidden;   
    9.     }   
    10. -->   
    11. </style>  
    Java代碼
    1. <style type="text/css">  
    2. <! --   
    3. li {  
    4.     width: 200px;  
    5.     white-space:nowrap;  
    6.     text-overflow:ellipsis;   
    7.     -o-text-overflow:ellipsis;   
    8.     overflow: hidden;  
    9.     }  
    10. -->  
    11. </style>  


    10.web標(biāo)準(zhǔn)中定義id與class有什么區(qū)別嗎
    一.web標(biāo)準(zhǔn)中是不容許重復(fù)ID的,比如 div id="aa" 不容許重復(fù)2次,而class 定義的是類(lèi),理論上可以無(wú)限重復(fù), 這樣需要多次引用的定義便可以使用他.
    二.屬性的優(yōu)先級(jí)問(wèn)題
    ID 的優(yōu)先級(jí)要高于class,看上面的例子
    三.方便JS等客戶端腳本,如果在頁(yè)面中要對(duì)某個(gè)對(duì)象進(jìn)行腳本操作,那么可以給他定義一個(gè)ID,否則只能利用 遍歷頁(yè)面元素加上指定特定屬性來(lái)找到它,這是相對(duì)浪費(fèi)時(shí)間資源,遠(yuǎn)遠(yuǎn)不如一個(gè)ID來(lái)得簡(jiǎn)單.

    11.如何垂直居中文本
    將元素高度和行高設(shè)為一致。
    Code: 

    1. <style type="text/css">   
    2. <!--    
    3. div {   
    4.     height:30px;   
    5.     line-height:30px;   
    6.     border:1px solid red   
    7.     }   
    8. -->   
    9. </style>  
    Java代碼
    1. <style type="text/css">  
    2. <!--   
    3. div {  
    4.     height:30px;  
    5.     line-height:30px;  
    6.     border:1px solid red  
    7.     }  
    8. -->  
    9. </style>  


    12.如何對(duì)齊文本與文本輸入框
    加上 vertical-align:middle;
    Code: 

    1. <style type="text/css">   
    2. <!--    
    3. input {   
    4.     width:200px;   
    5.     height:30px;   
    6.     border:1px solid red;   
    7.     vertical-align:middle;   
    8. }    
    9. -->   
    10. </style>  
    Java代碼
    1. <style type="text/css">  
    2. <!--   
    3. input {  
    4.     width:200px;  
    5.     height:30px;  
    6.     border:1px solid red;  
    7.     vertical-align:middle;  
    8. }   
    9. -->  
    10. </style>  


    13.為什么FF下面不能水平居中呢
    FF下面設(shè)置容器的左右外補(bǔ)丁為auto就可以了
    Code: 

    1. <style type="text/css">   
    2. <!--    
    3. div {   
    4.     margin:0 auto;   
    5. }   
    6. -->   
    7. </style>  
    Java代碼
    1. <style type="text/css">  
    2. <!--   
    3. div {  
    4.     margin:0 auto;  
    5. }  
    6. -->  
    7. </style>  


    14.為什么FF下文本無(wú)法撐開(kāi)容器的高度
    標(biāo)準(zhǔn)瀏覽器中固定高度值的容器是不會(huì)象IE6里那樣被撐開(kāi)的,那我又想固定高度,又想能被撐開(kāi)需要怎樣設(shè)置呢?辦法就是去掉height設(shè)置 min-height:200px; 這里為了照顧不認(rèn)識(shí)min-height的IE6 可以這樣定義:
    Code: 

    1. {   
    2. height:auto!important;   
    3. height:200px;   
    4. min-height:200px;   
    5. }  
    Java代碼
    1. {  
    2. height:auto!important;  
    3. height:200px;  
    4. min-height:200px;  
    5. }  


    15.為什么IE6下容器的寬度和FF解釋不同呢
    Code: 

    1. <?xml version="1.0" encoding="gb2312"?>   
    2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   
    3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />   
    4. <style type="text/css">   
    5. <!--   
    6. div {   
    7.     cursor:pointer;   
    8.     width:200px;   
    9.     height:200px;   
    10.     border:10px solid red   
    11.     }   
    12. -->   
    13. </style>   
    14. <div ōnclick="alert(this.offsetWidth)">web 標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全</div>  
    Java代碼
    1. <?xml version="1.0" encoding="gb2312"?>  
    2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
    3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
    4. <style type="text/css">  
    5. <!--  
    6. div {  
    7.     cursor:pointer;  
    8.     width:200px;  
    9.     height:200px;  
    10.     border:10px solid red  
    11.     }  
    12. -->  
    13. </style>  
    14. <div ōnclick="alert(this.offsetWidth)">web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大 全</div>  


    問(wèn) 題的差別在于容器的整體寬度有沒(méi)有將邊框(border)的寬度算在其內(nèi),這里IE6解釋為200PX ,而FF則解釋為220PX,那究竟是怎么導(dǎo)致的問(wèn)題呢?大家把容器頂部的xml去掉就會(huì)發(fā)現(xiàn)原來(lái)問(wèn)題出在這,頂部的申明觸發(fā)了IE的qurks mode,關(guān)于qurks mode、standards mode的相關(guān)知識(shí),請(qǐng)參考:
    [url]http://www.microsoft.com/china/msdn/library/webservices/asp.net/
    ASPNETusStan.mspx?mfr=true[/url]

    16.為什么web標(biāo)準(zhǔn)中IE無(wú)法設(shè)置滾動(dòng)條顏色了
    解決辦法是將body換成html
    Code: 

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   
    2. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />   
    3. <style type="text/css">   
    4. <!--    
    5. html {   
    6.     scrollbar-face-color:#f6f6f6;   
    7.     scrollbar-highlight-color:#fff;   
    8.     scrollbar-shadow-color:#eeeeee;   
    9.     scrollbar-3dlight-color:#eeeeee;   
    10.     scrollbar-arrow-color:#000;   
    11.     scrollbar-track-color:#fff;   
    12.     scrollbar-darkshadow-color:#fff;   
    13.     }   
    14. -->   
    15. </style>  
    Java代碼
    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
    2. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
    3. <style type="text/css">  
    4. <!--   
    5. html {  
    6.     scrollbar-face-color:#f6f6f6;  
    7.     scrollbar-highlight-color:#fff;  
    8.     scrollbar-shadow-color:#eeeeee;  
    9.     scrollbar-3dlight-color:#eeeeee;  
    10.     scrollbar-arrow-color:#000;  
    11.     scrollbar-track-color:#fff;  
    12.     scrollbar-darkshadow-color:#fff;  
    13.     }  
    14. -->  
    15. </style>  


    17.為什么我定義的樣式?jīng)]有作用呢
    這里你無(wú)法用.aa定義到li 遇到這種情況怎么解決呢?答案是提高.aa 的優(yōu)先權(quán) 比如#aa ul li.aa
    Code: 

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   
    2. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />   
    3. <style type="text/css">   
    4. <!--   
    5. #aa ul li {   
    6.     color:red   
    7.     }   
    8. .aa {   
    9.     color:blue   
    10.     }   
    11. -->   
    12. </style>   
    13. <div id="aa">   
    14. <ul>   
    15. <li class="aa">   
    16. web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web 標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題 大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全   
    17. </li>   
    18. </ul>   
    19. </div>  
    Java代碼
    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
    2. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
    3. <style type="text/css">  
    4. <!--  
    5. #aa ul li {  
    6.     color:red  
    7.     }  
    8. .aa {  
    9.     color:blue  
    10.     }  
    11. -->  
    12. </style>  
    13. <div id="aa">  
    14. <ul>  
    15. <li class="aa">  
    16. web 標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題 大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全web標(biāo) 準(zhǔn)常見(jiàn)問(wèn)題大全  
    17. </li>  
    18. </ul>  
    19. </div>  


    18.為什么無(wú)法定義1px左右高度的容器
    IE6下這個(gè)問(wèn)題是因?yàn)槟J(rèn)的行高造成的,解決的方法也有很多,例如:overflow:hidden | zoom:0.08 | line-height:1px

    19.為什么這個(gè)背景顏色無(wú)法顯示

    Code: 

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   
    2. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />   
    3. <style type="text/css">   
    4. <!--    
    5. ul {   
    6.     background:red   
    7.     }   
    8. li {   
    9.     float:left;   
    10.     width:180px;   
    11.     }   
    12. -->   
    13. </style>   
    14. <!--[if lte IE 6]>   
    15. <style>   
    16. .gainlayout { height: 1px; }   
    17. </style>   
    18. <![endif]-->     
    19. <ul class="gainlayout">   
    20. <li>web 標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全</li>   
    21. <li>web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大 全</li>   
    22. <li>web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全</li>   
    23. <li>web 標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全</li>   
    24. <li>web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大 全</li>   
    25. <div style="clear:both"></div>   
    26. </ul>  
    Java代碼
    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
    2. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
    3. <style type="text/css">  
    4. <!--   
    5. ul {  
    6.     background:red  
    7.     }  
    8. li {  
    9.     float:left;  
    10.     width:180px;  
    11.     }  
    12. -->  
    13. </style>  
    14. <!--[if lte IE 6]>  
    15. <style>  
    16. .gainlayout { height: 1px; }  
    17. </style>  
    18. <![endif]-->    
    19. <ul class="gainlayout">  
    20. <li>web 標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全</li>  
    21. <li>web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大 全</li>  
    22. <li>web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全</li>  
    23. <li>web 標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全</li>  
    24. <li>web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大 全</li>  
    25. <div style="clear:both"></div>  
    26. </ul>  

    IE中設(shè)置有背景色的ul并沒(méi)有顯示出來(lái),這個(gè)屬于haslayout問(wèn)題,解決的辦法也很多參考 http://www.satzansatz.de/cssd/onhavinglayout.htm
    解決方法之一:
    Code: 

    1. <!--[if lte IE 6]>   
    2. <style>   
    3. .gainlayout { height: 1px; }   
    4. </style>   
    5. <![endif]-->    
    Java代碼
    1. <!--[if lte IE 6]>  
    2. <style>  
    3. .gainlayout { height: 1px; }  
    4. </style>  
    5. <![endif]-->    


    20.怎么樣才能讓層顯示在FLASH之上呢
    解決的辦法是給FLASH設(shè)置透明
    Code:
    <param name="wmode" value="transparent" />

    21.怎樣使一個(gè)層垂直居中于瀏覽器中
    這里我們使用百分比絕對(duì)定位,與外補(bǔ)丁負(fù)值的方法,負(fù)值的大小為其自身寬度高度除以二
    Code: 

    1. <style type="text/css">   
    2. <!--    
    3. div {   
    4.     position:absolute;   
    5.     top:50%;   
    6.     left:50%;   
    7.     margin:-100px 0 0 -100px;   
    8.     width:200px;   
    9.     height:200px;   
    10.     border:1px solid red;   
    11.     }   
    12. -->   
    13. </style>  
    Java代碼
    1. <style type="text/css">  
    2. <!--   
    3. div {  
    4.     position:absolute;  
    5.     top:50%;  
    6.     left:50%;  
    7.     margin:-100px 0 0 -100px;  
    8.     width:200px;  
    9.     height:200px;  
    10.     border:1px solid red;  
    11.     }  
    12. -->  
    13. </style>  


    22 .圖片垂直與容器內(nèi)
    Code: 

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    2. <style type="text/css">   
    3. <!--    
    4. * {margin:0;padding:0}   
    5. div {   
    6.     width:500px;   
    7.     height:500px;   
    8.     border:1px solid #ccc;   
    9.     overflow:hidden;   
    10.     position:relative;   
    11.     display:table-cell;   
    12.     text-align:center;   
    13.     vertical-align:middle   
    14.     }   
    15. div p {   
    16.     position:static;   
    17.     +position:absolute;   
    18.     top:50%   
    19.     }   
    20. img {   
    21.     position:static;   
    22.     +position:relative;   
    23.     top:-50%;left:-50%;   
    24.     width:276px;   
    25.     height:110px   
    26.     }   
    27. -->   
    28. </style>   
    29. <div><p><img src="logo.gif" /></p></div>  
    Java代碼
    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    2. <style type="text/css">  
    3. <!--   
    4. * {margin:0;padding:0}  
    5. div {  
    6.     width:500px;  
    7.     height:500px;  
    8.     border:1px solid #ccc;  
    9.     overflow:hidden;  
    10.     position:relative;  
    11.     display:table-cell;  
    12.     text-align:center;  
    13.     vertical-align:middle  
    14.     }  
    15. div p {  
    16.     position:static;  
    17.     +position:absolute;  
    18.     top:50%  
    19.     }  
    20. img {  
    21.     position:static;  
    22.     +position:relative;  
    23.     top:-50%;left:-50%;  
    24.     width:276px;  
    25.     height:110px  
    26.     }  
    27. -->  
    28. </style>  
    29. <div><p><img src="logo.gif" /></p></div>  

    或者使用背景圖的辦法:
    Code:
    background:url("logo.gif") center no-repeat;

    23.如何讓div橫向排列
    橫向排列DIV可以使用浮動(dòng)的方式比如float:left,或者設(shè)置對(duì)象為內(nèi)聯(lián),還可以絕對(duì)定位對(duì)象等等.
    Code: 

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">   
    2. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />   
    3. <style type="text/css">   
    4. <!--    
    5. div {   
    6.     float:left;   
    7.     width:200px;   
    8.     height:200px;   
    9.     border:1px solid red   
    10.     }   
    11. -->   
    12. </style>   
    13. <div>web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全</div>   
    14. <div>web 標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大全</div>   
    15. <div>web標(biāo)準(zhǔn)常見(jiàn)問(wèn)題大 全</div>

    posted on 2010-04-11 00:17 梁良 閱讀(332) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): CSS

    <2010年4月>
    28293031123
    45678910
    11121314151617
    18192021222324
    2526272829301
    2345678

    導(dǎo)航

    公告

        歡迎光臨

    常用鏈接

    隨筆分類(lèi)

    隨筆檔案

    相冊(cè)

    .我的網(wǎng)站.

    友情博客

    開(kāi)源社區(qū)

    科技博客

    資料網(wǎng)站

    最新隨筆

    搜索

    最新評(píng)論

    閱讀排行榜

    Powered by:
    LonLeung
    Copyright © 梁良

    本頁(yè)生成時(shí)間:毫秒

    主站蜘蛛池模板: 国产精品黄页免费高清在线观看| 人妻在线日韩免费视频| 黄页免费在线观看| 成人无遮挡裸免费视频在线观看| 免费观看国产精品| 337p日本欧洲亚洲大胆艺术| 国产亚洲一卡2卡3卡4卡新区 | 亚洲乱码在线卡一卡二卡新区| 国产精品亚洲精品日韩电影| 一级毛片免费观看不卡的| 青青草国产免费久久久91| 久久久久久亚洲精品| 国产成人高清亚洲一区久久| 午夜免费福利片观看| 国产91在线免费| 亚洲第一页在线播放| 一道本在线免费视频| 歪歪漫画在线观看官网免费阅读| 国产午夜亚洲不卡| 亚洲综合久久精品无码色欲| 黄色免费在线网站| 免费国产人做人视频在线观看| 亚洲精品欧洲精品| 一级一级毛片免费播放| 一本无码人妻在中文字幕免费| 久久精品国产亚洲AV果冻传媒| 久久精品国产亚洲av瑜伽| 2019中文字幕在线电影免费| 亚洲人成网站在线观看青青| 欧洲 亚洲 国产图片综合| 国产精成人品日日拍夜夜免费| 免费中文字幕不卡视频| 亚洲乱码中文论理电影| 久久黄色免费网站| 亚洲日韩人妻第一页| 老司机亚洲精品影院在线观看| 无码区日韩特区永久免费系列 | 亚洲国产精品一区二区久久| 特a级免费高清黄色片| 成全视频免费高清| 亚洲性猛交xx乱|