IE7 bug - 无法使按钮向右浮动
我有一个包含按钮和页脚的页面。我无法让按钮正确浮动。我有以下代码:
<div style="float: right;">
<asp:Button ID="btnSubmit" OnClick="btnSubmit_Click" runat="server" Text="Save"
CssClass="button defaultbutton" />
</div>
<div style="clear:both;"></div>
我在网上做了一些研究,发现这是一个已知的错误: 修复在按钮元素内部使用浮动元素时的 IE6/7 问题
但是从链接添加 CSS 并没有解决问题。
关于如何解决这个问题有什么想法吗?
这是按钮的 CSS:
display: inline;
color: #ffffff;
font-family: arial;
font-size: 12px;
font-weight: bold;
text-decoration: none;
width: auto;
margin-left: 0;
margin-right: 0;
margin-top: 5px;
margin-bottom: 3px;
padding: 6px 24px;
border-radius: 2px;
这是默认按钮的 CSS:
background: #f24537;
border: 1px solid #d02718;
text-shadow: 1px 1px 0 #810e05;
I have a page that contains a button and a footer. I can't make the button float right. I have the following code:
<div style="float: right;">
<asp:Button ID="btnSubmit" OnClick="btnSubmit_Click" runat="server" Text="Save"
CssClass="button defaultbutton" />
</div>
<div style="clear:both;"></div>
I did some research on the net and found it is a known bug: Fixing IE6/7 problems when using floated elements inside of a button element
But adding the CSS from the link didn't fix the problem.
Any ideas on how to fix this?
Here is the CSS for button:
display: inline;
color: #ffffff;
font-family: arial;
font-size: 12px;
font-weight: bold;
text-decoration: none;
width: auto;
margin-left: 0;
margin-right: 0;
margin-top: 5px;
margin-bottom: 3px;
padding: 6px 24px;
border-radius: 2px;
And here is the CSS for defaultbutton:
background: #f24537;
border: 1px solid #d02718;
text-shadow: 1px 1px 0 #810e05;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经测试了 ASP 生成的结果代码。
我正在测试的确切页面是此处:http://jsbin.com/ololot。
我已经在 IE7 中尝试过此处:https://i.sstatic.net/cuXIf.png
在同一台计算机上的 Firefox 中 此处:https://i.sstatic.net/vh0i3.png
除非问题是填充的差异,我似乎无法复制你的问题。
我将根据更多信息编辑答案。
I've tested what I think is the resulting code produced by ASP.
The exact page I'm testing is here: http://jsbin.com/ololot.
I've tried it out in IE7 here: https://i.sstatic.net/cuXIf.png
In Firefox on the same machine here: https://i.sstatic.net/vh0i3.png
Unless the problem is the difference in padding, I don't seem to be able to replicate your problem.
I'll edit the answer upon further information.