1. 程式人生 > >div css Firefox和IE瀏覽器相容問題 用CSS實現cellSpacing屬性效果

div css Firefox和IE瀏覽器相容問題 用CSS實現cellSpacing屬性效果

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow

也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!

               

   div+css -  Firefox和IE瀏覽器相容問題 - 用CSS實現cellSpacing屬性效果

   [用CSS實現cellSpacing屬性效果 - 示例程式碼]

   <html>
       <head>
       </head>
       <body>
           <div>
               非CSS的cellSpacing實現
           </div>
           <table cellSpacing="10">
               <tr>
                   <td>1</td>
                   <td>2</td>
               </tr>
               <tr>
                   <td>3</td>
                   <td>4</td>
               </tr>
           </table>
           <div>
               用CSS實現時,Firefox中支援border-spacing,而IE不支援。
           </div>
           <table style="border-spacing: 10px;">
               <tr>
                   <td>1</td>
                   <td>2</td>
               </tr>
               <tr>
                   <td>3</td>
                   <td>4</td>
               </tr>
           </table>
           <div>
               用CSS實現時,IE不直接支援,但是可以藉助於expression實現,而Firefox不支援。
           </div>
           <table style="border-spacing: expression(this.cellSpacing=10);">
               <tr>
                   <td>1</td>
                   <td>2</td>
               </tr>
               <tr>
                   <td>3</td>
                   <td>4</td>
               </tr>
           </table>
           <div>
               同時使用時,可以實現相容Firefox和IE的cellSpacing效果。
           </div>
           <table style="border-spacing: 10px; border-spacing: expression(this.cellSpacing=10);">
               <tr>
                   <td>1</td>
                   <td>2</td>
               </tr>
               <tr>
                   <td>3</td>
                   <td>4</td>
               </tr>
           </table>
       </body>
   </html>

   [div+css - 關鍵詞]

div css

   [div+css - 論壇]

http://WebDev.board.newsmth.net/
http://WebGeeks.board.newsmth.net/
http://bbs.pku.edu.cn/, homepage看版
http://forum.csdn.net/SList/HTMLCSS/
http://groups.google.com/group/alt.html
http://groups.google.com/group/comp.infosystems.www.authoring.html

http://groups.google.com/group/comp.infosystems.www.authoring.stylesheets

   [div+css - 工具]

   Internet Explorer Developer Toolbar, http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&amp;displaylang=en

   The W3C Markup Validation Service:, http://validator.w3.org/

   [div+css - 常見問題]

較驗div+css格式, http://validator.w3.org/
div+css的margin縮寫方式
div+css的padding縮寫方式
連結的:link,:visited,:hover,:active四種狀態

   div+css使用backgroundRepeat樣式設定背景圖片的顯示方式, http://msdn2.microsoft.com/en-us/library/ms530721.aspx

   page-break-before設定列印分佈符

   url()指示符, http://www.w3.org/TR/CSS21/syndata.html#value-def-uri

   !important規則, http://www.w3.org/TR/CSS21/cascade.html#important-rules

   table中直接輸入的文字和其他標記設定不同的顏色

   CSS標準中級聯的文件, http://www.w3.org/TR/CSS21/cascade.html#cascade

   [div+css - Firefox和IE瀏覽器相容問題]

水平居中,Firefox使用margin-left: auto; margin-right: auto; IE6 使用text-align: center;
垂直居中,Firefox中使用display: table-cell; vertical-align: middle;可以實現div垂直居中,而IE6中則需要藉助IE6中css的特點實現垂直居中。
!important標記,Firefox支援!important標記,IE6忽略!important標記,!important需要放在前面才能起作用
手形滑鼠指標,使用cursor: pointer;
padding的尺寸,在Firefox中padding是計算在width之外的,而IE6是計算在width之內的
margin的尺寸,在IE6中帶有float樣式的元素的margin尺寸計算有誤,需要藉助padding和!important標記實現相容

   使用word-wrap設定自動折行, 僅對IE有效

   <li style="overflow:hidden">在Firefox下會丟失左側的圓點

   Internet Explorer的CSS參考資料, http://msdn2.microsoft.com/en-us/library/ms531209.aspx

   用CSS實現cellSpacing屬性效果, border-spacing: 10px; border-spacing: expression(this.cellSpacing=10);

   

   [div+css - CSS標準]

   Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification:級聯樣式表第2級第1次修改(CSS 2.1)規範, http://www.w3.org/TR/CSS21/

   4.3.2 Lengths長度, http://www.w3.org/TR/CSS21/syndata.html#length-units

   

  

   邊距屬性, http://www.w3.org/TR/CSS21/box.html#propdef-margin-top

   8.5 Border properties邊框屬性, http://www.w3.org/TR/CSS21/box.html#border-properties

   

   [div+css - XHTML標準]

   5.6. Table Modules - Table模組, http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#sec_5.6.

   [div+css - 其他HTML問題]

   使用OPTGROUP對SELECT中的OPTION分組

   nowrap標記設定不自動折行, http://www.w3.org/TR/1998/REC-html40-19980424/struct/tables.html#adef-nowrap

   leftmargin設定頁面左邊距, topmargin設定頁面上邊距

   disabled屬性, http://msdn2.microsoft.com/en-us/library/ms533732.aspx

   About Font Embedding:關於字型嵌入, http://msdn2.microsoft.com/en-us/library/ms533034.aspx

           

給我老師的人工智慧教程打call!http://blog.csdn.net/jiangjunshow

這裡寫圖片描述