css - Show text label next to the input box? -


how can show label 'regularexpressionvalidator' on right input box , align input box?

putting outside div makes label left on other side. enter image description here

<style type="text/css" media="all"> <!-- label{     display:inline-block;     width:100px; } --> </style> ...........  <div style="text-align:center;">         <label>phone:</label>             <asp:requiredfieldvalidator id="req_phone" controltovalidate="formwphone">*</asp:requiredfieldvalidator>          <asp:textbox id="formwphone" runat="server" />             <asp:regularexpressionvalidator id="regularexpressionvalidator2" runat="server" controltovalidate="formwphone"              validationexpression= "">enter valid phone number</asp:regularexpressionvalidator> </div> 

your issue you've center-aligned of content in wrapper div:

<div style="text-align:center;"> 

when text added, changes width of content centered.

try changing to:

<div style="text-align:left;"> 

or remove style altogether.

then if need space on left, add padding or margin container div.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -