2013-07-28 3 views
1

다음을 단순화하는 방법이 있습니까? 그렇다면 어떻게해야합니까?이 CSS를 단순화 할 수있는 방법이 있습니까?

.ui-layout-north { 
    border-top: none; 
    border-left: none; 
    border-right: none; 
    padding: 0px; 
} 
.ui-layout-west { 
    border-top: none; 
    border-left: none; 
    border-bottom: none; 
    padding: 0px; 
} 
#inner { 
    border-top: none; 
    border-right: none; 
    border-bottom: none; 
    padding: 0px; 
} 
#inner-center { 
    border-top: none; 
    border-left: none; 
    border-right: none; 
    padding: 0px; 
} 
#inner-south { 
    border-right: none; 
    border-left: none; 
    border-bottom: none; 
    padding: 0px; 
} 

현재 작업에서 볼 수 있습니다

#inner, #inner-center, #inner-south ... { 
    border-top: none; 
    border-left: none; 
    border-right: none; 
    padding: 0px; 
} 

다음 단지 각각 지정 : 당신은 쉼표로 각 ID를 분리 할 수 ​​있습니다

+1

.ui-layout-center, .ui-layout-south, .ui-layout-north, .ui-layout-west { border-style: none; padding: 0px; } .ui-layout-north { border-bottom-style:solid; } .ui-layout-west { border-right-style: solid; } .ui-layout-center { border-bottom-style: solid; } .ui-layout-south { border-top-style: solid; } 
및 # 내측 중심들은 재사용을 허용하고 ID 클래스 메이커보다 255 배 이상 특이 그 규칙들을 덮어 쓰기가 더 어려워집니다. .inner의 클래스를 사용하고 해당 요소에 ID가 필요한 경우에는 그렇게하고 스타일 지정 규칙에는 ID를 사용하지 마십시오. –

답변

0
.ui-layout-north, .ui-layout-west, #inner, #inner-center { 
    border-top: none; 
    padding: 0px; 
} 

.ui-layout-north, .ui-layout-west , #inner-center, #inner-south{ 
    border-left: none; 
    padding: 0px; 
} 

.ui-layout-west, #inner, #inner-south { 
    border-bottom: none; 
} 

.ui-layout-north, #inner, #inner-south { 
    border-right: none; 
} 
+0

각 블록에는 다른 지정자 집합이 있습니다. –

+0

죄송합니다. 나는 먼저 돋보기를 써야했다. 나는 이제 다른 사람들이 이미 살아있는 대답을 제시했음을 알 수있다. –

1
.ui-layout-north, 
.ui-layout-west, 
#inner, 
#inner-center, 
#inner-south { 
    border-top: none; 
    border-left: none; 
    border-right: none; 
    padding: 0px;  
} 

.ui-layout-north { 
    /* specify unique styles */ 
} 

.ui-layout-west { 
    /* specify unique styles */ 
} 

#inner { 
    /* specify unique styles */ 
} 

#inner-center { 
    /* specify unique styles */ 
} 

#inner-south { 
    /* specify unique styles */ 
} 
2

다음 요소를 지정하십시오. 사용 만 직업

심지어 #inner 대한 제안 사용 클래스 로서도

http://jsfiddle.net/hQ5mY/1/

관련 문제