2

我需要帮助解决我正在构建的网站遇到的这个小问题。我有一个包含指向不同网站链接的图像列表,大多数情况下一切看起来都很好,但是当我将鼠标悬停在该行的最后一个上时,下面的链接会出于某种奇怪的原因移动。我想不通!

想象一下它最初的样子:

[img1] [img2] [img3]
[img4] [img5] [img6]

当我将鼠标悬停在右侧的任何图像/链接上时会发生这种情况:

[img1] [img2] [img3]
              [img4]
[img5] [img6] [img7]

这是我的代码:

.sites{
float:left;
width:215px;
background: #eee;
text-align:center;
margin: 0px 13px 15px 0px;
border: 1px solid #ccc;
padding:10px;
}

.sites p{
margin:0px;
padding:10px;
font:bold;
}

.sites a{
border-bottom: 5px solid #000;
border-top: 5px solid #000;
display:block;
}

.sites a:hover{
border-bottom: #F90;
border-top: #f90;
}

这是我的 HTML:

<div id="main-content">    
<h1> Check out all our DEADicated sites: </h1>
<div class="sites">
    <a href="http://www.eyeem.com/TheDEADicated" target="_blank">
    <img src="images/sites/eye-em.jpg" width="215" height="150" alt="EyeEm"/></a>
    <p> EyeEm </p>
</div>
<div class="sites">
    <a href="http://www.facebook.com/DeadSaraArg" target="_blank">
    <img src="images/sites/fb-argentina.jpg" width="215" height="150" alt="Facebook    Argentina"/></a>
    <p> Facebook - Argentina </p>
</div>
<div class="sites">     
    <a href="https://www.facebook.com/pages/The-DEADicated-Canada/427270554005649?ref=hl" target="_blank">
    <img src="images/sites/fb-canada.jpg" width="215" height="150" alt="Facebook Canada"/></a>
    <p> Facebook - Canada </p>
</div>

<div class="sites">
    <a href="http://www.facebook.com/ThedeadicatedEgypt" target="_blank">
    <img src="images/sites/fb-egypt.jpg" width="215" height="150" alt="Facebook Egypt"/></a>
    <p> Facebook - Egypt </p>

</div>
<div class="sites">
    <a href="http://www.facebook.com/DeadSaraItaly?ref=hl" target="_blank">
    <img src="images/sites/fb-italy.jpg" width="215" height="150" alt="Facebook Italy"/></a>
    <p> Facebook - Italy </p>
</div>
<div class="sites">     
    <a href="http://www.facebook.com/thedeadicatedmexico" target="_blank">
    <img src="images/sites/fb-mexico.jpg" width="215" height="150" alt="Facebook Mexico"/></a>
    <p> Facebook - Mexico </p>
</div>
<br/>
<div class="sites">
    <a href="http://www.facebook.com/DeadSaraTheDeadicatedUK" target="_blank">
    <img src="images/sites/fb-uk.jpg" width="215" height="150" alt="Facebook UK"/></a>
    <p> Facebook - UK </p>
</div>

</br><br><br>

<h2> To join TheDEADicated, click <a href="http://musichype.com/artists/dead-sara" target="_blank">HERE</a>! </h2>



</div> 

我对网页设计很陌生。请帮忙?

4

1 回答 1

1

如果没有 html,我不能肯定地说,但仅从您的 css 中,您的.sites a:hover规则应该设置border-top-color: #F90; border-bottom-color: #F90;,而不仅仅是边框顶部和边框底部。

于 2013-03-06T06:09:24.080 回答