字段集上的圆角
我注意到“fieldset”标签在 IE 上呈现圆角边框(它在其他浏览器上呈现方形)。
<fieldset>
<legend>My legend</legend>
</fieldset>
但是如果我在字段集上设置 CSS 样式,圆角就会消失!
有人知道为什么吗? 如何保留圆角但使用另一种边框颜色?
[编辑]:抱歉造成混乱,我不问如何在 Firefox/其他浏览器上有圆角,我想知道如何在 IE 上保持圆角并具有另一种边框颜色( border-color:red; 在字段集上将圆形更改为方形...)。
I noticed that the "fieldset" tag renders a rounded corner border on IE (it renders squared on the other browsers).
<fieldset>
<legend>My legend</legend>
</fieldset>
BUT if i set a CSS style on the fieldset, the rounded corners disappear!!
Anybody know why?
How to keep the rounded corners but with another border color?
[EDIT] : sorry for the confusion, i don't ask how to have rounder corners on firefox/other browsers, i want to know how to keep the rounder corners on IE and have another border color (border-color:red; on the fieldset changes the rounds to squares...).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
该站点修复了有关字段集圆角和 IE10 的问题。 IE 中仍然存在问题(悲伤的表情)。 你必须让它在 100% 的时间内浮动才能工作。
http://www.456bereastreet.com/archive/201302/fieldset_legend_border-radius_and_box-阴影/
This site has a fix for the issues concerning fieldset rounded corners and IE10. There are still issues in IE (sad face). You have to float it to work 100% of the time.
http://www.456bereastreet.com/archive/201302/fieldset_legend_border-radius_and_box-shadow/
没有什么原因,浏览器的行为不同已不是什么秘密。
您探索过 -moz-border-radius 属性吗?
我认为类似的东西
可以在 FireFox/Mozilla 中使用,但自从我尝试以来已经很长时间了:D
There is no WHY as such, it is no secret that the browsers behave differently.
Have you explored the -moz-border-radius attribute?
I think something like
works in FireFox/Mozilla, but it has been a long time since I tried :D
某些项目(按钮、输入框)默认使用系统视觉样式 - 在默认的 Windows XP/Vista 主题中,字段集具有圆角。 (例如,查看“显示属性”。)
例如,如果您将任何样式分配给
,它也会失去其悬停效果、渐变效果和其他内容。
Some items (buttons, input boxes) are using the system visual styles by default - and in the default Windows XP/Vista themes, fieldsets have rounded corners. (Take a look at Display Properties, for example.)
If you assign any style to an
<input />
, for example, it will lose its hover effects, gradients and other things too.IE 中的边框仅在以下情况下呈圆形: 1) 您在性能 | 下启用了“在按钮上的窗口上使用视觉样式”。 视觉效果选项卡。 说白了:如果你启用了“XP主题”,它就会四舍五入,当你有经典的Win2000外观时,它就不会四舍五入。
第二个要求 2) 是字段集“无边框相关 CSS”。 每当您分配边框颜色、边框样式或边框宽度时,“圆度”就会消失,没有解决方法。 对于输入(按钮和字段)、文本框和选择标签也是如此。 每当 IE 发现控件没有 CSS 主题来渲染时,它就会将“默认 Windows 主题”应用于控件。
The borders in IE are only round when 1) You have the 'Use visual styles on windows on buttons' enabled under the Performance | Visual Effects tab. To put it blunt: if you have 'XP theming' enabled it will be rounded, when you have the classic Win2000 look, it will not be rounded.
The second requirement 2) is 'no border-related CSS' for the fieldset. Whenever you assign a border-color, or border-style, or border-width, the 'roundness' is gone, there is no workaround for that. The same goes for input (both buttons and fields), textbox and select-tags. Whenever IE finds no CSS theming for the control to render it will apply the 'default Windows theme' to the control.
您可以使用 CSS 3 border-radius 属性,该属性适用于 Firefox 和 Safari:
You could use CSS 3 border-radius property, which will work on Firefox and Safari:
http://www. webteacher.ws/2010/02/27/style-a-fieldset-with-rounded-corners-using-css/
http://www.webteacher.ws/2010/02/27/style-a-fieldset-with-rounded-corners-using-css/