位置绝对,底部0,firefox无法正常工作

时间:2017-07-17 09:05:18

标签: html css firefox css-position absolute

所以我试图在文本的左上角和右下角放置一个使用imtr,但是firefox没有和我合作:

我有跨文本,并在

之前和之后放置imgs
.komentarz-main .content span{
position: relative;
height: 100%;
}

.komentarz-main .content span:after{
display: block;
content: '';
position: absolute;
width: 11px;
height: 10px;
background-image: url("../img/cudzyslow.png");
background-size: contain;
background-repeat: no-repeat;
right: -15px;
bottom: 0px;
}

firefox结果: enter image description here

chrome结果: enter image description here

任何想法?

2 个答案:

答案 0 :(得分:1)

尝试以下代码,只需替换您的css代码

.komentarz-main .content span{
    position: relative;
    height: 100%;
    display: inline-block;
}

.komentarz-main .content span:after{
    display: inline-block;
    content: '';
    position: relative;
    width: 11px;
    height: 10px;
    background-image: url(../img/cudzyslow.png);
    background-size: contain;
    background-repeat: no-repeat;
    bottom: 0px;
}
<div class="komentarz-main">
<div class="content">
<span>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</span>
</div>
</div>

答案 1 :(得分:0)

.komentarz-main .content span{ 
 display:inline-block; 
}