CSS - 移动文本而不移动块

时间:2014-04-07 16:33:56

标签: html css

我在我想要的地方放置了很少的东西,事情看起来很酷,但我需要在“buble”中移动一个简短的文字。使它看起来像: enter image description here

但是atm看起来像: enter image description here

我的CSS:

#news #right ul li{
    list-style-position: inside;    /* Bodka v novom riadku vo vnutry */
    list-style-type: none;          /* bez bodky */ 
    background-image: url("images/black_bar.png");
    background-repeat: repeat-x;
    color: #898989;
    height:45px;
    width: 569px;
    line-height: 45px;
    border 1px;
    border-color: #898989;
    position: relative;
    right: 40px;
}
#news #right ul li:hover{
    list-style-position: inside;    /* Bodka v novom riadku vo vnutry */
    list-style-type: none;          /* bez bodky */ 
    background-image: url("images/blue_bar.png");
    background-repeat: repeat-x;
    color: #FFFFFF;
    height:45px;
    width: 569px;
    line-height: 45px;
    border 1px;
    border-color: #898989;
    position: relative;
    right: 40px;
}  
#news #right ul li a:visited{
    color: #898989;
}
#news #right ul li a:active{
    color: #898989;
}
#news #right ul li a:link{
    color: #898989;
}
#news #right ul{
    padding 0px auto;
    margin: 0px auto;
}
.newsheading{
    background-image: url("images/cs_icon.png");
    background-repeat: no-repeat; 
    margin-left: 20px;
    padding-left: 30px;
    margin-top: 10px;
    height: 22px;
    line-height: 22px;
    display: inline-block;
}    

#news #right ul li:hover .newsheading{
    color: #FFFFFF;         
}

 #news #right ul li .blue-arrow{
    background-image: url("images/blue_arrow.png");
    background-repeat: no-repeat;
    width: 31px;
    height: 46px;
    position: absolute;
    right: 568px;
    display: none;     
}
#news #right ul li:hover .blue-arrow{
    display: inline-block; 
}

 #news #right ul li .balloon{
    width: 32px; 
    height: 27px; 
    background-image: url("images/white_buble.png");
    margin-left: 250px;
    display: none; 
}
#news #right ul li:hover .balloon{
    display: inline-block;
    vertical-align: middle;
    color: #1d5f97; 
}
 #news #right ul li .blueballoon{
    width: 32px; 
    height: 27px; 
    background-image: url("images/blue_buble.png");
    display: inline-block;
    margin-left: 250px;
    vertical-align: middle;
    text-align: center;
    color: #FFFFFF;
}

#news #right ul li:hover .blueballoon{
    display: none;
    vertical-align: middle; 
}           

我的HTML看起来像:

  <span id="right">
    <ul>
    <li><span class="blue-arrow"></span><span class="newsheading"><a href="#">Gamesites má nový web ou jeeee!</a></span><span class="blueballoon">10</span><span class="balloon">10</span></li>
    <li><span class="blue-arrow"></span><span class="newsheading"><a href="#">Gamesites má nový web ou jeeee!</a></span><span class="blueballoon">10</span><span class="balloon">10</span></li>
    <li><span class="blue-arrow"></span><span class="newsheading"><a href="#">Gamesites má nový web ou jeeee!</a></span><span class="blueballoon">10</span><span class="balloon">10</span></li>
    <li><span class="blue-arrow"></span><span class="newsheading"><a href="#">Gamesites má nový web ou jeeee!</a></span><span class="blueballoon">10</span><span class="balloon">10</span></li>
    <li><span class="blue-arrow"></span><span class="newsheading"><a href="#">Gamesites má nový web ou jeeee!</a></span><span class="blueballoon">10</span><span class="balloon">10</span></li>
    </ul>
  </span>

bubles中的文字已移出,我需要更改它,是否有人可以帮助我?即使我在悬停时设置#FFFFFF,我也有悬停时更改文字颜色的问题:newsheading

可以在以下位置找到实时预览: http://funedit.com/andurit/try2/

感谢您阅读此帖:)

1 个答案:

答案 0 :(得分:2)

#news #right ul li .blueballoon {
  line-height: 24px;
}