fbell884
fbell884

Reputation: 1

ASP.NET HTML - Textboxes are extremely close together and need help putting space in between them

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <h4>Send your comments.</h4>
    <hr />
    <div class="form-group">
        @Html.LabelFor(m => m.FromName, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.TextBoxFor(m => m.FromName, new { @class = "form-control" })
            @Html.ValidationMessageFor(m => m.FromName)
        </div>
    </div>
    <div class="clearfix"></div>
    <div class="form-group">
        @Html.LabelFor(m => m.FromEmail, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.TextBoxFor(m => m.FromEmail, new { @class = "form-control" })
            @Html.ValidationMessageFor(m => m.FromEmail)
        </div>
    </div>
    <div class="clearfix"></div>
    <div class="form-group">
        @Html.LabelFor(m => m.Message, new { @class = "col-md-2 control-label" })
        <div class="col-md-10">
            @Html.TextBoxFor(m => m.Message, new { @class = "form-control" })
            @Html.ValidationMessageFor(m => m.Message)
        </div>
    </div>
    <div class="clearfix"></div>
    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <input type="submit" class="btn btn-default" value="Send" />
        </div>
    </div>
}

I have tried using clearfix, as well as modifying the css margins in form-group. If anyone has any suggestions, feel free. Program works perfectly, just the formatting that is off.

Upvotes: 0

Views: 56

Answers (2)

Shad
Shad

Reputation: 1219

You seem to be using clearfix in the wrong place?

Just add it along side form-group

<div class="form-group clearfix">

Upvotes: 1

kok yang huan
kok yang huan

Reputation: 1

Try either one will solve the problem.

  • Add the class form-horizontal to the form

or

  • Add the class row to the <div class="form-group">

Upvotes: 0

Related Questions