拉右后底部对齐

时间:2014-07-25 14:01:39

标签: css asp.net-mvc twitter-bootstrap

这是我的代码:

<div class="row">
    <div class="col-xs-4">
        <h2>Some header text</h2>
    </div>
    <div id="div1" class="col-xs-8">
        <div class="pull-right">
            @using (Html.BeginForm("ChangePageSizeAction", "myController"))
            {
                @Html.AntiForgeryToken()
                <small>Page Size</small>
                @Html.DropDownList("pageSize", null, htmlAttributes: new { @class = "form-control", onchange = "this.form.submit();" })
            }
        </div>
        <div id="div2" class="pull-right" style="padding-right:10px">
            @Html.PagedListPager(Model, page => Url.Action("Index", new { page }),
                        new PagedListRenderOptions()
                        {
                            MaximumPageNumbersToDisplay = 3,
                            DisplayPageCountAndCurrentLocation = true,
                            PageCountAndCurrentLocationFormat = "Page {0} of {1}",
                        })
        </div>
    </div>
</div>

这是输出: enter image description here

我想将PagedListPager与DropDownList旁边的底部对齐,如下所示: enter image description here

我尝试将div1样式设置为position:relative,将div2样式设置为position:absolute; bottom:0但不起作用。

1 个答案:

答案 0 :(得分:0)

在Morpheus发表评论之后,我在他的jsfiddle示例中找到了差异,因此我在我的css类中发现了一个错误(margin:0)。

所以,抱歉错误的问题。