2017-06-17 32 views
0

實現CSS文件的正確方法是什麼?我得到的錯誤在Netbeans的,當我打開這個CSS文件:在CSS文件中找到意外的令牌字符串

@CHARSET "UTF-8"; 

body { 
    background-color: #EEEEEE; 
} 

#login_box 
{ 
    display: inline-block; 
    text-align: center; 
    position: fixed; 
    top: 0; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    width: 350px; 
    height: 200px; 
    margin: auto; 
    background-color: #FFFFFF;">Full Center ON Page 
    } 

    .btn_submit 
    { 
    display: inline-block; 
    text-align: center; 
    border:solid 0px; 
    width: 80px; 
    height: 25px; 
    margin: auto; 
    font-weight: bold; 
    font-size: 13px; 
    background-color: #EEEEEE;">Full Center ON Page 
} 

#login_title 
{ 
    text-align:center; 
    color: #000000; 
    margin: 15px; 
    font-weight: bold; 
    font-size: 15px; 
} 

#login_box_inner 
{ 
    display: inline-block; 
} 

.login_font 
{ 
    text-align:center; 
    color: #000000; 
    font-weight: bold; 
    font-size: 12px; 
    width:80px; 
    height:30px; 
} 

.login_fields 
{ 
    width:100px; 
    border:solid 1px #58A8D5; 
    outline:solid 1px #E7F3F8; 

    background-color: #000000; 

    -webkit-text-fill-color: inherit !important; 
    -webkit-box-shadow: 0 0 0px 1000px #FFFFFF inset; 
} 


.login_fields:focus{ 
    outline:solid 0px ; 
} 

我得到在這裏的CSS代碼警告"Unexpected token STRING found"

enter image description here

也許我需要刪除 「」? 你可以給我一些建議,我可以解決這個問題嗎?

+1

您需要刪除這些'>全中心ON Page'。如果他們是評論,將它們包裝在這樣的評論中*/Full Center ON Page * /' – LGSon

+1

「>完整中心ON頁面從任何地方刪除此 –

+1

您應該刪除」>「字符。和註釋掉完全中心在這樣的頁面上/ * Full center On Page */ – AMH

回答

1

嗯,突出顯示的行中,">Full Center ON Page部分創建了一個語法錯誤。

如果這些(他們在許多位置在你的CSS)的意思是註釋包起來/* */

background-color: #FFFFFF; /* ">Full Center ON Page */ 
1

您可以使用封閉在/**/字符串的CSS添加註釋:

#login_box 
{ 
    display: inline-block; 
    text-align: center; 
    position: fixed; 
    top: 0; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    width: 350px; 
    height: 200px; 
    margin: auto; 
    background-color: #FFFFFF; /* >Full Center ON Page */ 
} 

.btn_submit 
{ 
    display: inline-block; 
    text-align: center; 
    border:solid 0px; 
    width: 80px; 
    height: 25px; 
    margin: auto; 
    font-weight: bold; 
    font-size: 13px; 
    background-color: #EEEEEE; /* >Full Center ON Page */ 
}