css - 照片右边的表格

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

我在使用 Bootstrap 时遇到了一些问题。我现在有点困惑。我需要在 Asp.net MVC 中的照片右侧添加一个表单。我的主页上有一个渲染主体,然后在另一个 View 中我有这个 Bootstrap 代码:

@using (Html.BeginForm("EditarUtilizador", "Account", null, FormMethod.Post,
                                                  new { enctype = "multipart/form-data" }))
{
    System.Diagnostics.Debug.WriteLine(@Html.DisplayFor(modelItem => modelItem.ImagePath));
    <div class="form-horizontal">
        <h4>Editar Perfil Pessoal</h4>
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
    <fieldset class="col-md-3">
        @if (Model.ImagePath != null)
        {
            <img src="~/Images/@Html.DisplayFor(modelItem => modelItem.ImagePath)" width="150" height="150" />
        }
        else
        {
            <img src="~/StaticImages/default-user-image.png" width="150" height="150" />
        }
        <div class="editor-field">
            <input id="ImagePath" title="Upload a product image"
                   type="file" name="file" />
        </div>
    </fieldset>

    <div class="form-group" >
        @Html.LabelFor(m => m.Utilizador, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.DisplayFor(m => m.Utilizador, new { @class = "form-control"})
            @Html.ValidationMessageFor(model => model.Utilizador, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.EditorFor(m => m.Password, new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.NovaPassword, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.EditorFor(m => m.NovaPassword, new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.DisplayFor(m => m.Email, new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.Email, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.Telemóvel, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.EditorFor(m => m.Telemóvel, new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.Telemóvel, "", new { @class = "text-danger" })
        </div>
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.DataNascimento, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.EditorFor(m => m.DataNascimento, new { @class = "form-control", type = "date", })
            @Html.ValidationMessageFor(model => model.DataNascimento, "", new { @class = "text-danger" })
        </div>

我目前的情况是这样的:

Bootstrap Web Page

我想让表格出现在右边,但在我的例子中它出现在图像下方。

最佳答案

因为 <div>元素是 block 级的,默认情况下它们会堆叠在一起。更改 CSS 以获得您想要的内容。

关于css - 照片右边的表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37350937/

相关文章:

jquery - 高度为 100% 且宽度匹配的圆

jquery - Bootstrap css 输入按钮插件对齐问题

javascript - Bootstrap JavaScript 不工作

c# - 在 ASP.Net MVC View 中显示是/否而不是复选框

c# - Linq查询如何从今天的日期中选择最后一周的数据

html - 在 CSS 中使用较低分辨率时宽度不会改变

javascript - 将更多内容加载到页面后,Bootstrap Affix 不起作用

HTML 容器未完全获取其内容且两个容器未成 block

c# - mvc ajax表单发布空列表问题

html - Bootstrap 下拉菜单不适用于 iOS