2013-04-22 24 views
1

我已經爲Firefox指定了以下CSS。@ -moz-document url-prefix()未在Firefox中呈現

.bill-tab-button { 
    width: 33.3%; 
    height: 100%; 
    float: left; 
    border-left: 1px solid rgb(197, 196, 196); 
    border-bottom: 1px solid rgb(197, 196, 196); 
    box-sizing: border-box; 
    font-family: MyriadProReg; 
    cursor: pointer; 
} 

.bill-tab-fixed-width { 
    width: 105px; 
} 

.bill-tab-button-selected { 
    border-bottom: 2px solid red; 
    box-sizing: border-box; 
    color: #b83709; 
    border-left: none; 
} 

.bill-tab-button span { 
    padding: 3px; 
    vertical-align: -3px; 
} 

/* Firefox Specific CSS Styling */ 

@-moz-document url-prefix(){ 
    .bill-tab-button { 
     width:33.2%; 
     height: 90%; 
     float: left; 
     border-left: 1px solid rgb(197, 196, 196); 
     border-bottom: 1px solid rgb(197, 196, 196); 
     box-sizing: border-box; 
     font-family: MyriadProReg; 
    } 

    .bill-tab-fixed-width { 
     width: 104.0px;!important 
    } 

    .bill-tab-button-selected { 
     border-bottom: 2px solid red; 
     box-sizing: border-box; 
     color: #b83709; 
     border-left: none; 
    } 
} 

當我測試這些無服務器(碼頭)的CSS獲取的完美呈現!我正在使用這個CSS的春天的Web應用程序,我使用碼頭作爲服務器。當我運行該應用程序時,瀏覽器呈現默認的CSS而不是Firefox特定的CSS。

是否存在任何與URL前綴衝突的內容。請幫幫我!

+0

請在您的問題中包含以下內容:項目的'WEB-INF/web.xml'副本,css的路徑(例如:'/ css/main.css')以及嘗試在你的瀏覽器中取得CSS(例如:'http:// localhost:8080/myapp/css/main.css') – 2013-04-22 13:42:08

回答

1

CSS應該永遠不會渲染,因爲url-prefix()之間的空間不應該存在。您需要刪除它,或者至少將它移動到()之外。我還看到一個錯位的!important這似乎是它可以安全地被完全省略,或者如果不是,它應該是來;前:

@-moz-document url-prefix() { 
    .bill-tab-button { 
     width:33.2%; 
     height: 90%; 
     float: left; 
     border-left: 1px solid rgb(197, 196, 196); 
     border-bottom: 1px solid rgb(197, 196, 196); 
     box-sizing: border-box; 
     font-family: MyriadProReg; 
    } 

    .bill-tab-fixed-width { 
     width: 104.0px !important; 
    } 

    .bill-tab-button-selected { 
     border-bottom: 2px solid red; 
     box-sizing: border-box; 
     color: #b83709; 
     border-left: none; 
    } 
} 

如果這仍然不能解決問題,別的東西是錯誤的。您需要根據評論內容提供更多信息。

+0

空間是問題! :) 謝謝! – 2013-04-23 04:09:40