Html 如何在IE7模式下保持这两个按钮之间的空间?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4967530/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I maintain the space between these two buttons in IE7 mode?
提问by DaveDev
I have 2 buttons horizontally aligned. In most browsers there's a space between them, but if you view this:
我有 2 个按钮水平对齐。在大多数浏览器中,它们之间有一个空格,但是如果您查看以下内容:
in "Browser Mode: IE7" & "Document Mode: IE7 Standards" you can see that the 2 buttons are stuck together.
在“浏览器模式:IE7”和“文档模式:IE7 标准”中,您可以看到 2 个按钮粘在一起。
Can somebody suggest how I can correct this so that there is always a consistent space between these buttons?
有人可以建议我如何纠正这个问题,以便这些按钮之间始终保持一致的空间吗?
回答by TimFoolery
Have you tried putting
in between them?
你有没有试过放在
它们之间?
IE does not render "padding" to W3C standards. (See herefor explanation.) That's almost assuredly where this problem is coming from, so you'll need to insert something in between them to make it work properly.
IE 不会按照 W3C 标准呈现“填充”。(请参阅此处的解释。)这几乎可以肯定是这个问题的来源,因此您需要在它们之间插入一些东西以使其正常工作。
回答by Sotiris
you can use the margin-left
property to move the button some pixels right such as margin-left:3px
, but first you have to remove the whitespace between the input
and button
.
您可以使用margin-left
属性来动按钮右侧的一些诸如像素margin-left:3px
,但首先你要删除的空白input
和button
。
Example: http://jsfiddle.net/2HP43/18/
回答by Swetha
This solves my problem:
这解决了我的问题:
*padding: 2px; /* "*" is for lte IE 7 */
回答by Dan Hanly
Try this
尝试这个
<input type="submit" class="button" id="Submit1" value="Remove" name="btnRemoveFunds"> <button class="button" id="Button1">Add More Funds</button>
ensures you have a space in there
确保你在那里有一个空间
回答by bhaskar
this might help you to solve the problem
这可能会帮助您解决问题
回答by Safi
I have 3 solutions to this problem:
对于这个问题,我有 3 个解决方案:
The easiest is to use
but of course this can't be used professionally.Use
padding
property- Use the
margin-left
property.
最简单的是使用,
但当然这不能专业使用。使用
padding
财产- 使用
margin-left
物业。