CSS Attribute selector overriding Existing styles
We are dealing with browser compatability issue for IE8. Borders for text box does not appear to be in blue. We are using attribute selector input[type="text"] { border: solid 1px #7F9DB9; } Which is applied only to IE8 And not IE6. However the problem is some text box already has border defined in it. Which are being overwritten. I开发者_运维技巧 tried using expression but it seems to work only when DocType is not present. The other option left for us is to make each of the textbox classes in css for border with !important, Which is very tedious indeed for the big project. Second solution is to use jquery which mgmt is aganist. Can any one guide as how to target this.
Are you sure you've defined property at the appropriate level, and not again somewhere that would override it?
IE6 does not support attribute selectors, you will have to target it another way. I would suggest adding a CSS class -- the default styles are going to be different in every browser.
You could also try being more specific, as littlefoot mentioned. Try adding more of the cascade to reference that element and you might be able to override it. Avoid using !important wherever possible.
精彩评论