문제

I was trying to validate my css and this bit of code gave me an error in the css validator, was just wondering what i might be doing wrong here, the error is:

select   Parse Error [inp_submit]
select   Parse Error select) { padding-top: 3px; }

CSS Code below:

content form :not(#inp_submit, select) {
    padding-top: 3px;
}

If you have any suggestions as to what might be going wrong please let me know, thanks.

도움이 되었습니까?

해결책

In CSS, unlike in jQuery, :not() doesn't accept a comma-separated list of selectors. The parse error is probably a result of the validator trying to split the entire selector by that comma, which obviously won't work.

For your CSS to work you need to chain two :not() selectors instead:

content form :not(#inp_submit):not(select) {
    padding-top: 3px;
}

(Also, just as a sanity check, are you sure your content selector is correct? It's a valid type selector, but there is no content element in HTML.)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top