Chrome的默认按钮样式 [英] Chrome default button style

查看:659
本文介绍了Chrome的默认按钮样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它是possbile获取默认的浏览器按钮样式的CSS?

Is it possbile to get the default Chrome button style in CSS?

当然,很多人会说使用 http://pastebin.com/zjkW2cJe 或的 http://pastebin.com/xKGBZFPg

Of course many would say use http://pastebin.com/zjkW2cJe or http://pastebin.com/xKGBZFPg

但我想这个按钮CSS code ...

But i want this button CSS code...

推荐答案

如果你想在纯CSS规则,你可以检查按钮元素,并检查了项目说用户代理样式表。

If you want the pure CSS rules, you can inspect the button element and check out the entries saying "user agent stylesheet".

在我的Chrome 9,他们是这样的:

In my Chrome 9, they look like this:

input, textarea, keygen, select, button, isindex, datagrid {
margin: 0em;
font: -webkit-small-control;
color: initial;
letter-spacing: normal;
word-spacing: normal;
....... etc. much more

但是,如果你从字面上想要的规则本身呈现一个按钮,以使在其他浏览器相同的按钮,我认为这是不可能的:默认的按钮会被浏览器的用户界面,甚至底层操作系统呈现。在我的Windows 7中,默认按钮看起来是这样的:

however, if you literally want the rules for natively rendering a button, in order to render the same button in other browsers, I think that's impossible: A default button will be rendered by the Browser's UI or even the underlying operating system. In my Windows 7, the default button looks like this:

这风格,据我所知,是不是在CSS规则。你将不得不使用背景图片,边框,圆角等来重建它。如果你不介意使用jQuery,库如 jQuery UI的有seducingly简单的解决方案这一点。

This style, as far as I know, is not in the CSS rules. You would have to rebuild it using background images, borders, rounded corners etc. If you don't mind using jQuery, libraries like jQuery UI have seducingly simple solutions for this.

这篇关于Chrome的默认按钮样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆