为了简单起见,我在文档中创建了我的样式以突出显示我的问题。我有一排4个链接,样式看起来像按钮。下一个链接(第3项)我隐藏使用CSS。在IE8 +,Chrome,Firefox中,它可以很好地工作,但在IE7中,取消和接受按钮(下一步按钮的位置)之间存在间隙。在IE7中隐藏CSS和CSS锚点
<!DOCTYPE html>
<html>
<head>
<title>Test Page</title>
<style type="text/css">
.ButtonBar
{
margin-top: 20px;
text-align: center;
}
.LinkButton
{
background-color: #01699b;
border: 0px solid;
border-radius: 14px;
color: #fff;
cursor: pointer;
font-weight: bold;
height: 28px;
padding: 0px 11px 0px 11px;
overflow: hidden;
position: relative;
text-decoration: none;
display: inline-block;
line-height: 28px;
}
.NextButton
{
display: none;
}
</style>
</head>
<body>
<div class="ButtonBar">
<a class="PreviousButton"><span class="LinkButton">Previous</span></a>
<a class="CancelButton"><span class="LinkButton">Cancel</span></a>
<a class="NextButton"><span class="LinkButton">Next</span></a>
<a class="AcceptButton"><span class="LinkButton">Accept</span></a>
</div>
</body>
</html>
如果从背景色中删除从.LinkButton类的所有CSS除了它不一样的,我只是其中包括这一切显示什么,我到目前为止做的事情。
我该怎么做才能解决这个问题?
如果将链接浮起,会发生什么情况? – Pete 2013-02-14 10:14:26
左浮动确实有效,我认为必须在它们之间添加一个保证金空间以将它们分开。但是,我将如何居中对齐“按钮栏”中的按钮? – 2013-02-14 10:24:14
啊你不能使用浮动左边然后 – Pete 2013-02-14 10:29:16