I have a 'div 태그를 여러' ul '' 포함하는 것이다.
div ul:first-child {
background-color: #900;
}
하지만, 내 정보정의다음 시도_횟수 ul '태그' 를 제외한 첫 번째 don& 서로를 위해 CSS 속성을 설정 # 39, 빗나갔다.
div ul:not:first-child {
background-color: #900;
}
div ul:not(:first-child) {
background-color: #900;
}
div ul:first-child:after {
background-color: #900;
}
어떻게 쓰기 CSS. 각 요소를 제외한 first" ";?
[실제로 작동됨] [1] 의 버전 중 너회가 게시하기를 모든 최신 브라우저 (여기서 CSS 선택기를 레벨 3 은 [대상] [3]):
div ul:not(:first-child) {
background-color: #900;
}
기존 브라우저를 지원해야 하는 경우에는 다른 경우, 또는 '뒤에' 없습니다. selector& # 39 의 [제한은라이센스] [4] ([단순해졌습니다 선택기를] [5] 표시됨과 인수를 승인하면 뿐이다) 을 다른 기법을 사용할 수 있습니다.
그 후, revoke" " 너희는너희가 비해 우수하기 유효범위 정의하시려면 규칙이 없다. 조건부, 그 범위를 제한하는 것이 왜 있는 것이 특징이다.
div ul {
background-color: #900; /* applies to every ul */
}
div ul:first-child {
background-color: transparent; /* limits the scope of the previous rule */
}
이 때 각 CSS 속성을 사용하여 제한 범위 [기본값입니다] [6] 하는 설정값입니다.
[3]: http://caniuse.com/ # 성과 = css sel3 [4]: http://www.w3.org/TR/css3-selectors/ # 부정 [5]: http://www.w3.org/TR/css3-selectors/ # 간단한 선택기를 다프네 [6]: http://www.w3.org/TR/CSS2/colors.html # 배경 특성
이 CSS2 솔루션 (", 모든 'ul' 다음에 또 다른 'ul' ") 역시 더 브라우저를 통해 작동됨 사용할 수 있습니다.
div ul + ul {
background-color: #900;
}
[인접한 형제 선택기를] '와' 이 ',' n 형제 달리 없습니다. (http://www.w3.org/TR/CSS2/selector.html # 인접한 선택기를) ie7+ 의해 지원됩니다.
이 모든 정적 웹 페이지를 완벽하게 노력해야 합니다.
이후 '이 아닌' 없습니다. 수락됨 ie6-8, 꼭 이래야겠어요 것이 좋습니다.
div ul:nth-child(n+2) {
background-color: #900;
}
그래서 'ul' 에서 부모 요소를 제외한 모든 첫 번째 선택할 수 있습니다.
'안' 선택기를 함께 사용할 수 있습니다
p:not(:first-child){}
p:not(:first-of-type){}
p:not(:checked){}
p:not(:last-child){}
p:not(:last-of-type){}
p:not(:first-of-type){}
p:not(:nth-last-of-type(2)){}
p:not(nth-last-child(2)){}
p:not(:nth-child(2)){}
네 선택기를 없습니다. 함께 사용할 수 있습니다 '같은 선택기를 없습니다. ()' '내' 벨로 사용할 수 있습니다
any_CSS_selector:not(any_other_CSS_selector){
/*YOUR STYLE*/
}
>. '부모 없이 사용할 수 있습니다' 없습니다. 선택기를 잘 알려져 있다.
:not(:nth-child(2)){
/*YOUR STYLE*/
}
더 많은 예를
any_CSS_selector:not(:first-child){
/*YOUR STYLE*/
}
any_CSS_selector:not(:first-of-type){
/*YOUR STYLE*/
}
any_CSS_selector:not(:checked){
/*YOUR STYLE*/
}
any_CSS_selector:not(:last-child){
/*YOUR STYLE*/
}
any_CSS_selector:not(:last-of-type){
/*YOUR STYLE*/
}
any_CSS_selector:not(:first-of-type){
/*YOUR STYLE*/
}
any_CSS_selector:not(:nth-last-of-type(2)){
/*YOUR STYLE*/
}
any_CSS_selector:not(:nth-last-child(2)){
/*YOUR STYLE*/
}
any_CSS_selector:not(:nth-child(2)){
/*YOUR STYLE*/
}
As I not (첫 아이를) '은 완벽한 솔루션이므로 사용되는' ul:
div ul:not(:first-child) {
background-color: #900;
}
이 때문에 '왜 우리는 할 수 없는 완벽한 사용하여 ul: (첫 아이를)' 의 css 적용하십시오 내부 요소. Like ',' a ', img 수명*을 스팬할 주기표시 상술합니다.
하지만 다른 솔루션을 사용할 경우:
div ul + ul {
background-color: #900;
}
및
div li~li {
color: red;
}
및
ul:not(:first-of-type) {}
및
div ul:nth-child(n+2) {
background-color: #900;
}
이러한 제한 국한됨 ul 수준의 CSS. 예를 들어, 적용할 수 없다 '를' 에 '수명*을 CSS + ul li& div ul # 39;.
div ul:not(:first-child) li{
background-color: #900;
}
및 드릴링됩니다.