14

我正在使用 tumblr 的代码提取 tumblr 提要,并使用 after: 添加图像作为帖子之间的分隔符。我想将图像居中,但没有运气这样做。由于 tumblr 生成内容,而不是我,我认为我不能使用 span 标签,这似乎是通常的答案。还有其他想法吗?

显示正在使用的提要的页面:lumn.net/index.shtml

CSS:

.tumblr_post:after {
    content: url(../img/flower.png);
    display: block;
    position: relative;
    margin-top: 42px;
    margin-bottom: 24px;
    margin-left: auto;
    margin-right: auto;
}
4

3 回答 3

18

试试这个:

.tumblr_post:after {
    content: url("../img/flower.png");
    display: block;
    margin: 42px auto 24px;
    position: relative;
    text-align: center;
    width: 100%;
}
于 2012-05-28T01:23:02.843 回答
6

虽然 Zoltan Toth 的答案有效,但它有一堆代码对预期的效果没有任何作用。这应该可以解决问题并且代码更少。

.tumblr_post:after {
    content: url("../img/flower.png");
    display: block;
    text-align: center;
}
于 2013-12-18T06:00:29.723 回答
4

这是所有屏幕上的有效解决方案:

.produit-col .img-produit::after{
    content: '';
    background: url("../img/icone.png") center no-repeat;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
}
于 2017-10-04T15:02:36.933 回答