重新设置表单按钮的 CSS 代码

发布于 2024-08-26 05:34:09 字数 488 浏览 4 评论 0原文

我使用了CSS重置来重置一些常用的项目。代码是这样的:

html, body, div, h1, h2, h3, h4, ul, ol, li, form, input, fieldset, textarea {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
}
ul {list-style: none outside none;}
img, fieldset {border: 0;}
h1, h2, h3, h4 {font-weight: normal;}
em {font-style: italic;}
strong {font-weight: bold;}

我知道有YUI和Meyer的重置,但我用的是这个。

现在,我遇到的问题是我无法让提交按钮再次正常显示。我当然可以从列表中删除 input 并完成它,但我想知道如何取回它,因为我将来可能需要它。

I used a CSS reset to reset some commonly-used items. The code is this:

html, body, div, h1, h2, h3, h4, ul, ol, li, form, input, fieldset, textarea {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
}
ul {list-style: none outside none;}
img, fieldset {border: 0;}
h1, h2, h3, h4 {font-weight: normal;}
em {font-style: italic;}
strong {font-weight: bold;}

I know there's YUI and Meyer's reset, but I use this one.

Now, the problem I'm experiencing is that I can't get the submit buttons to look normally again. I could ofcourse remove the input from the list and be done with it, but I'd like to know how to get it back, since I might need that in the future.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

韵柒 2024-09-02 05:34:10
input[type="submit"]
{
    background-color: buttonface;
    border: 2px outset buttonface;
    color: buttontext;
}
input[type="submit"]
{
    background-color: buttonface;
    border: 2px outset buttonface;
    color: buttontext;
}
我只土不豪 2024-09-02 05:34:10

使用 javascript 迭代您已更改的属性可能是一个好主意,甚至只是通过 Firefox 之类的工具查看它以获得正确的值,然后您就可以将它们设置为正确的默认值。

根据我的记忆,我认为 IE、FireFox 和 Safari 之间的按钮默认大小存在相当大的差异 - 我并不真正使用 Opera,但我认为那里存在大小问题 - 所以如果你要在按钮上设置填充CSS 在 Safari 和 Firefox 中可能无法正确渲染。

It might be a good idea to iterate through the properties you have changed using javascript or even just looking at it through something like firefox to get the right values, then you would be able to set them to the correct defaults.

From memory I think there are quite significant size differences in the default sizes of buttons between IE, FireFox and Safari - I dont really use opera but I assume there are size issues there - so if you were then to set a padding on the button in CSS it might not render correctly any more in Safari and firefox.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文