2013-04-18 3 views
0

전역 CSS 파일에서 클래스 이름을 지정하여 일부 설정을 상속하는 컨테이너가 있습니다. 그러나 배경을 더 구체적으로 설정하기 위해 다른 클래스를 사용하려고 시도하면 아무 것도 변경되지 않습니다. 내 HTML의CSS 배경 속성 재정의

흥미로운 부분 :

<html> 
     <head> 
      <link rel="stylesheet" type="text/css" href="/styles/global.css"> 
      <link rel="stylesheet" type="text/css" href="/styles/register.css"> 
     </head> 
     <body class="class1 class2"> 
      <div> 
       some content 
      </div> 
     </body> 
    </html> 

그리고 텍스트의 색상이 완벽하지만 무시되고 레지스터

.class2 { 
     color: black; 
     background-color: lightgray; 
    } 

글로벌

.class1 { 
     /*Shadowing for 3D effect*/ 
     -moz-box-shadow:inset 0px 1px 2px 0px #caefab; /*pale green*/ 
     -webkit-box-shadow:inset 0px 1px 2px 0px #caefab; /*inner/outer, hz-offset, vert-offset, blur-rad, spread, color*/ 
     box-shadow:inset 0px 1px 2px 0px #caefab; 
     /*Background gradient effect*/ 
     background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #46bf46), color-stop(1, #1d911d)); /*dark green to light green*/ 
     background:-moz-linear-gradient(center top, #46bf46 5%, #1d911d 100%); 
     filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#46bf46', endColorstr='#1d911d'); 
     /*Rounded corners*/ 
     -moz-border-radius:10px; 
     -webkit-border-radius:10px; 
     border-radius:10px; 
     /*Border*/ 
     border:1px solid #46bf46; 
     /*text settings*/ 
     color: white; /*like chalk*/ 
     text-decoration:none; /*this is default*/ 
     text-shadow:1px 1px 0px #777; /*hzoff vtoff blur color*//*gray makes letters pop out*/ 
     font-family:Verdana, sans-serif; 
     font-size:20px; 
     font-weight:bold; 
    } 

그리고 마지막으로 CSS에 대한 CSS를 배경을 변경할 수 없습니다.

답변

2

CSS에는 텍스트 색상이 없습니다. 그것은 입니다.

배경과 관련해서 배경색이 아닌 배경 인 속성을 모두 사용해보십시오. 어쩌면 브라우저 그래디언트가이를 재정의하는 것일 수 있습니다.

+0

당신 말이 맞습니다. 점은'배경'에있다. – ncm

+0

감사! 나는 항상 텍스트 색상/색상의 코드를 엉망으로 만든다. 나는 CSS에 너무 익숙하지 않다. – Jaws212