html - 在按钮之间添加空间?

标签 html css navigation rollover

您好,我这里有一个代码,除了一件事外,它是完美的。代码中每个按钮之间没有空格。我试过 margin ,但不幸的是它是一个无序列表,所以我有点困惑。我将添加或替换什么以在两个按钮之间留出空间。帮助?? :(

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<style type="text/css">

    .rollovericons a#terms{
        display: block;
        width:138px;
        height:27px;
        background:  url(http://icpy.webs.com/button/Terms.png) no-repeat;
    }

    .rollovericons a:hover#terms{
        background: url(http://icpy.webs.com/button/Terms0.png) no-repeat;
    }
    .rollovericons a#contact{
        display: block;
        width:138px;
        height:27px;
        background:  url(http://icpy.webs.com/button/contact.png) no-repeat;
    }

    .rollovericons a:hover#contact{
        background: url(http://icpy.webs.com/button/contact0.png) no-repeat;
    }

</style>

<body>

<div class="rollovericons">
    <a href="http://www.twitter.com" id="terms"></a>
    <a href="http://www.twitter.com" id="contact"></a>
</div>

</body>

最佳答案

只是做:

.rollovericons a{
    margin: 10px;
}

这将为每个 <a> 添加边距rollovericons 内的元素类。

关于html - 在按钮之间添加空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17644088/

相关文章:

javascript - element.parentNode.removeChild() 方法在 Internet Explorer 中不起作用

html - autocapitalize ="none"不适用于 Android 版 Firefox 中的 &lt;input type ="search">

css - 是否有没有任何类的元素的 CSS 选择器?

javascript - 是否有一个插件可以在我的网页中显示 HTML 代码

javascript - 在流体固定 div 中居中多个元素

css - 如何将第二级添加到下拉导航 css 中的子菜单

html - 我可以在不删除代码的情况下隐藏我的网站页脚吗?

javascript - 通过使用 jquery 检查选​​中哪个单选按钮来执行事件

CSS Syels 不适用于多个控件

ios - 从表 XIB 识别并导航到 Storyboard View Controller