如何改变这个元素的方向?

时间:2015-12-26 08:32:39

标签: html css3

我将此template用于我的网站皮肤。在这个section按下有两个div包含文本和图像。我想要改变图像和文本的位置。图像放在左侧,文本放在右侧。我的网站皮肤有rtl方向。

<div class="fh5co-press-item to-animate fadeInUp animated">
    <div class="fh5co-press-img" style="background-image: url(/DNN_test/Portals/_default/Skins/Crew/images/img_8.jpg)"></div>
    <div class="fh5co-press-text">
        <h3 class="h2 fh5co-press-title">Versatile <span class="fh5co-border"></span></h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Veritatis eius quos similique suscipit dolorem cumque vitae qui molestias illo accusantium...</p>
        <p><a href="#" class="btn btn-primary btn-sm">Learn more</a></p>
    </div>
</div>

1 个答案:

答案 0 :(得分:3)

.fh5co-press-img.fh5co-press-text上,您可以设置order属性。添加以下CSS:

.fh5co-press-text {
    order:2;
    position: relative;
}
.fh5co-press-img {
    order:1;
    position: relative;
}

您正在使用position:absolute;元素,您必须添加position:relative;