正如标题所说:
<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
发布于 2015-05-22 06:07:46
而是使用这种方法将其向下移动。删除行高并添加我的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;}
或将其从顶部按相对位置和(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;}
https://stackoverflow.com/questions/30383001
复制相似问题