2017-06-17 37 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 */ 
}