asp.net mvc - set font awesome icon into textbox -
i have problems set class textbox for, actual view:
and want this:
how can that? there code (razor):
<div class="row"> <!-- feedback --> <article class="feedback"> <div class="widget-title">deja un mensaje </div> @using (html.beginform("contact_partial", "contactmodels", formmethod.post)) { <h6>campos requeridos*</h6> <br /> @*<div class="input-group">*@ <div class="col-md-9"> @*@html.labelfor(model => model.name, "nombre*", new { @class = "pull-left" })*@ <i class="fa fa-user appointment"></i> @html.textboxfor(model => model.name, new { @class = "form-control", @style = "width:100%", @placeholder = "nombre*" }) @html.validationmessagefor(model => model.name, "", new { @class = "text-danger" }) </div> <br /> <div class="col-md-9"> <i class="fa fa-envelope appointment"></i> @html.textboxfor(model => model.email, new { @class = "form-control", @style = "width:100%", @placeholder = "email*", @type = "email" }) @html.validationmessagefor(model => model.email, "", new { @class = "text-danger" }) </div> <br /> <div class="col-md-9"> <i class=" fa fa-align-left appointment"></i>@html.textareafor(model => model.comments, new { @class = "form-control", @style = "width:100%", @placeholder = "mensaje*" }) @html.validationmessagefor(model => model.comments, "", new { @class = "text-danger" }) </div>
html code:
<article class="feedback"> <div class="widget-title">deja un mensaje </div> <form action="/contactmodels/contact_partial/1" method="post"> <h6>campos requeridos*</h6> <br /> <div class="col-md-9"> <i class="fa fa-user appointment"></i> <input class="form-control" data-val="true" data-val-required="es necesario que ingrese su nombre" id="name" name="name" placeholder="nombre*" style="width:100%" type="text" value="" /> <span class="field-validation-valid text-danger" data-valmsg-for="name" data-valmsg-replace="true"></span> </div> <br /> <div class="col-md-9"> <i class="fa fa-envelope appointment"></i> <input class="form-control" data-val="true" data-val-required="es necesario que ingrese su correo" id="email" name="email" placeholder="email*" style="width:100%" type="email" value="" /> <span class="field-validation-valid text-danger" data-valmsg-for="email" data-valmsg-replace="true"></span> </div> <br /> <div class="col-md-9"> <i class=" fa fa-align-left appointment"></i><textarea class="form-control" cols="20" data-val="true" data-val-minlength="es necesario que ingrese al menos 10 caracteres" data-val-minlength-min="10" data-val-required="ingrese algĂșn comentario por favor" id="comments" name="comments" placeholder="mensaje*" rows="2" style="width:100%">
<input type="submit" value="enviar" class="btn button" /> </div> </form> </article> </div>
and css (if don't use it, it's same problem, icon appears above text)
.widget-appointment { display: none; } .widget-appointment i,i.appointment{ position:absolute; z-index: 1; top: 0; left: 0; width: 50px; height: 50px; font-size: 24px; line-height: 50px; text-align: center; color: #fff; } i.appointment{ position:relative; margin-right:5px; margin-bottom:5px; } .widget-appointment i:after,i.appointment:after { content: ''; position: absolute; top: 50%; left: 100%; margin-top: -4px; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left-width: 4px; border-left-style: solid; } .widget-appointment input, .widget-appointment textarea { height: 50px; padding: 13px 10px 13px 65px; } .widget-appointment .captcha-wrapper input{ padding: 13px 6px; } .widget-appointment textarea { height: auto; } .widget-appointment .row { position: relative; margin-bottom: -1px; }
i don't know how can put textbox area, thinks that's problem so, reading , appreciated
detail : firstly remove br tags , apply absolute class tag, , apply relative div control absolute position,
<div class="col-md-9"> <div class="relative"> <i class="fa fa-user appointment"></i> <input type="text" value="" style="width:100%" placeholder="nombre*" name="name" id="name" data-val-required="es necesario que ingrese su nombre" data-val="true" class="form-control"/> <span data-valmsg-replace="true" data-valmsg-for="name" class="field-validation-valid text-danger"></span> </div>
css here :
.relative{position:relative;} .appointment{position:absolute;} input, textarea{padding-left:50px;}
Comments
Post a Comment