html - 行高扩展了 href 范围

标签 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

最佳答案

而是使用这种方法将其向下移动。删除 line-height 并添加我的 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;

关于html - 行高扩展了 href 范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30383001/

相关文章:

html - 我可以强制 html 元素呈现特定的媒体大小吗?

javascript - Node.js、Ajax发送和接收Json

html - 在 A4 大小的 div 中定位页脚

Javascript - 元素的 CSS 样式在附加时不显示

html - 底部 :0 DIV 内的问题居中文本

javascript - 如何更改按钮的值并在单击时添加更多按钮以形成表单?

html - 如何删除将鼠标悬停在图像上时出现的缩放图标?

jquery - css 配置文件随机加载

html - ie7 与 bootstrap CSS 问题与 div 和定位

html - 使用 CSS 选择 Avenir Next 粗体变体(更新 10.10.2)