2011-04-27 72 views
1

我有以下的CSS。身体风格不再适用

body { 
     font-family: Arial;  
     font-size: 12px;  
     color: #666666;   
     line-height: 18px;  
     background: url('../bg.jpg') no-repeat bottom left; 
} 

规则奇怪停止应用的身体。当我改变参数时,什么都没有发生。 我解决它如下。

body { 
      font-family: Arial;  
      font-size: 12px;  
      color: #666666;   
      line-height: 18px;  
      background: url('../bg.jpg') no-repeat bottom left; 
    } 
body { 
      font-family: Arial;  
      font-size: 12px;  
      color: #666666;   
      line-height: 18px;  
      background: url('../bg.jpg') no-repeat bottom left; 
    } 

它的工作,但是当我删除一个身体{...}规则它不起作用。

你知道为什么会发生这种情况吗?

谢谢

+0

这是哪种浏览器? CSS文件中是否有其他内容可能会干扰它? – paulmorriss 2011-04-27 10:52:46

+0

在铬和火狐。你是什​​么意思?我必须粘贴相同的body {}样式两次。它之前和之前一起工作。 – xralf 2011-04-27 11:03:26

+0

通过东西我的意思是CSS文件除了身体规则的其他任何东西。 – paulmorriss 2011-04-27 11:19:37

回答

1

检查有没有上述声明有语法错误,例如未闭合的括号({})或非端接规则()。通过CSS验证程序运行此操作可能会为您标记以下问题:http://jigsaw.w3.org/css-validator/