html - 将 div 的内容推到右边

标签 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

最佳答案

我们来看看更新后的 Fiddle。 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>

关于html - 将 div 的内容推到右边,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32622041/

相关文章:

javascript - 在 Canvas 元素上使用 ng-keypress

html - &lt;!--[if lt IE 7 ]><html class ="ie ie6"lang ="en"> &lt;![endif]-->

javascript - 使用javascript切换div的动态高度

google-chrome - Chrome HTML5 内置视频控件 css

Html 按钮提交未完全显示

jquery - 选定的选项卡不会显示其中的内容

html - 如何在 Razor CheckBoxFor() 中设置 Bootstrap 复选框

Javascript/Jquery 在窗口中找到最上面的段落

html - Bootstrap中嵌套文本元素相关的列表高度扩展

html - 使用 overflow-y 时防止垂直剪辑