将div的内容推送到右侧

时间:2015-09-17 03:13:23

标签: html css twitter-bootstrap

我有一个评论区域,用户可以评论和回复评论。我想显示评论及其回复。问题是答复与父评论没有正确对齐。

JSFiddle

CSS

.alignleft {
    float: left;
}
.alignright {
    float: right;
}
.comment-icon {
    padding-right: 0px;
    padding-left: 0px;
    width: 60px;
    margin-bottom: 5px;
}

目前的结果:

enter image description here

这就是我想要的。

enter image description here

1 个答案:

答案 0 :(得分:0)

请在这里查看更新的小提琴。 Updated JsFiddle

<div class="row replies">

                    <div class="col-sm-10 reply-area pull-right">
                        <p class="alignleft">Peter &bull; 2014-12-12</p>
                        <p class="alignright">
                            <span class="badge votes">4</span><a class="comment-vote-up" href="#"><span data-count="1" class="glyphicon glyphicon-thumbs-up up"></span></a></span>
            <a class="comment-vote-down" href="#"><span class="glyphicon glyphicon-thumbs-down"></span></a></p>
                        <hr style="clear: both">
                        he'd
                    </div>
                <div class="col-sm-2 comment-icon pull-right">
                        <img src="https://cdn3.iconfinder.com/data/icons/ultimate-social/150/34_google_plus-512.png" alt="" class="img-circle"  width="60" height="60"/>
                    </div>
                </div>