重新设置表单按钮的 CSS 代码
我使用了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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 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.