6

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

<!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>
4

3 回答 3

20

做就是了:

.rollovericons a{
    margin: 10px;
}

这将为类中的每个<a>项目添加一个边距rollovericons

于 2013-07-14T21:49:16.430 回答
2

I added a class called space which will add a space in betwween the buttons.

heres the jsfiddle for you to see: http://jsfiddle.net/mFfAX/

.space {margin-bottom:15px}
于 2013-07-15T00:09:32.357 回答
0

尝试这个:

.rollovericons ul li {
display: inline;
list-style-type: none;
padding-right: 7px;
}

<div class="rollovericons">
<ul>
<li><a href="http://www.twitter.com" id="terms"></a></li>
<li><a href="http://www.twitter.com" id="contact"></a></li>
</ul>
</div>
于 2013-07-14T21:51:32.973 回答