Find if class has border in css -


find if class has border in css only, using attribute selector or other means.if not having apply border.intention not fall on either jquery. possible acheive?


edited include response @nag (op):

in ie8 there no border select. i'm trying css reset this:

select, input[type="file"], textarea {     border: solid 1px #7f9db9;  } 

the problem is overriding preexisiting style because of specificity. tried use expression filter doctype in ie8 not seem work.

css has no concept, or implementation, of if/else statements, not possible in css only.

however, if define border element, , later redefine border second statement override first (assuming equally specific selector), i'm unsure why need apply border if element doesn't have border defined:

div {     border: none; /* removes border */ }  /* other stuff */  div {     border: 1px solid #f90; /* defines border */ } 

similarly:

div {     border: 5px solid #0f0; /* defines border */ }  /* other stuff */  div {     border: 1px solid #f90; /* re-defines border */ } 

if can define use-case might possible further.


edited address further information in question:

in ie8 there no border select. i'm trying css reset this:

select, input[type="file"], textarea {     border: solid 1px #7f9db9; } 

the problem is overriding preexisiting style because of specificity. tried use expression filter doctype in ie8 not seem work.

if problem specificity, options have either increase specificity of selector want apply, ideally use id, or multiple ids, in selector (the id of ancestor element fine) since that's specific selector available.

or, can decrease specificity of selector want override.

it's worth noting select element difficult style reliably since it's rendered underlying os, rather browser itself, consistent within operating system.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -