开发者

Revert button/input CSS to default

I have CSS rules on button input:

button {border:solid 1px black;}

As long as I apply any border to an input or button, the browser switches the presentation of that input form OS (rendered by OS with shadowed butotn, rounded corners, hoover cyan etc.) to standard bo开发者_Python百科x-model.

Now I want to revert that for some class of buttons. For example I want:

<button class="default-os">Looks like Windows-made</button> to look like without any styles at all.

Is there a way to do that? I have tried various none and inherit values of CSS rules, but none of them works.


I'm going to say the answer is "no way" sorry :/

I would find some way reversing it - apply your custom button style via a class, then just don't add the class to the "regular" buttons. If you can't modify the HTML for some reason then you might have to get creative with your CSS selector rules, but I'd have to see the HTML in question.


Try reversing what you are doing. Instead of trying a 'default-os' class, change your button style to '.styled-button' and specify that on the box-element buttons, and then don't specify a class on the buttons you want to have the default OS look.


It would be easier to give your button a special class when you want to change it with the border and leave it untouched.

However you could try to use !important to get it back to behaving normally with a combination of things.

.default-os{
  border: none !important; 
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜