javascript - How to center align the actual TextBox in Asp.net website -


i have following html/asp code want center textbox on display page. attaching code below. preferably want see label beside textbox once in center.

 <center>  <div class="container"  id="textbox4" runat="server" width="181px"   bordercolor="black" borderstyle="solid">     <div class="row">       <div class='col-sm-6'>         <div class="form-group">           <div class='input-group date' id='datetimepicker1'>          <p style="color: #000000; font-weight: bold; "> start date , time&nbsp;&nbsp;&nbsp; <asp:textbox id="tb4" runat="server" cssclass="form-control" width="374px" style="text-align: center">             </asp:textbox></p>                <span class="input-group-addon">                         <span class="glyphicon glyphicon-calendar"></span>             </span>           </div>         </div>       </div>       <script type="text/javascript">           $(function () {               $('#datetimepicker1').datetimepicker();           });       </script>     </div>   </div></center> 

try code. remove id=tb4 width , add class.

<%@ page language="c#" autoeventwireup="true" codebehind="webform1.aspx.cs" inherits="webapplication11.webform1" %>  <!doctype html>  <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title></title>     <link href="content/bootstrap.css" rel="stylesheet" /> </head> <body>     <form id="form1" runat="server">          <div class="container" id="textbox4" runat="server" width="181px" bordercolor="black" borderstyle="solid">             <div class="row">                 <div class='col-lg-12'>                     <div class="row">                         <div class="form-group">                         <div class="col-lg-4">                              &nbsp;                         </div>                         <div class="col-lg-4">                             <div class='input-group date' id='datetimepicker1'>                                 <div class="text-center">                                        <p style="color: #000000; font-weight: bold;">                                     start date , time&nbsp;&nbsp;&nbsp;                                           <asp:textbox id="tb4" runat="server" cssclass="form-control"  style="text-align: center">                                 </asp:textbox>                                 </p>                                 </div>                                   <span class="input-group-addon">                                     <span class="glyphicon glyphicon-calendar"></span>                                 </span>                             </div>                         </div>                         <div class="col-lg-4">                              &nbsp;                         </div>                      </div>                      </div>                  </div>             </div>         </div>      </form> </body> </html> 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -