Pregunta

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.

¿Fue útil?

Solución

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.)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top