线高正在扩展a href范围

时间:2015-05-21 19:45:49

标签: html css

正如标题所说:

<style type="text/css" scoped>
    @media(min-width: 640px){
        .<?php echo $championget;?>{
            background-image: url('<?php echo 'assets/champions/'.$championget;?>_pc.jpg');
            background-position: center center;
        }
    }
    @media(max-width: 639px){
        .<?php echo $championget; ?>{
            background-image: url('<?php echo 'assets/champions/'.$championget; ?>_mobile.jpg');
            background-position: center center;
        }
    }
</style>
<?php   echo '<a href="index.php?Champion='.$championget.'"><div class="';
    echo $championget;
    echo ' champion"><p id="champion_text">'.$championget.'</p></div></a>';
?>

执行此操作的#champion_text CSS:

#champion_text{
    color:white;
    line-height: 60px;
    font-size: 23px;
    text-shadow: -1px -1px 0 #000,  
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
}

显示问题的图片:http://imgur.com/XPmtrBd

1 个答案:

答案 0 :(得分:0)

而是使用这种方法将其向下移动。删除行高并添加我的CSS (大写) ...

#champion_text{
color:white;
/*line-height: 60px;*/
DISPLAY: INLINE-BLOCK;
PADDING-TOP: 30px; /*You'll have to play width the amount... 30px is just my guess */
font-size: 23px;
text-shadow: -1px -1px 0 #000,  
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;

}

OR 按相对位置向下推,并从顶部按下(30px)。请参阅下面的大写CSS。

#champion_text{
color:white;
/*line-height: 60px;*/
POSITION: RELATIVE;
TOP: 30px; /*You'll have to play width the amount... 30px is just my guess */
font-size: 23px;
text-shadow: -1px -1px 0 #000,  
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;

}