如何将标签与文本框高度对齐? [英] How Do I Align Label To Top Of The Textbbox Height?

查看:166
本文介绍了如何将标签与文本框高度对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用文本框来显示这样的标签









标签______________________________#

|

|

|

|

|

|

_______________________________#

这是代码片段

< fieldset  class  =   fldset > ;  
< legend>评论< / 图例 >
< asp:标签ID = Label1 runat = server Text = 标签 >
< asp:TextBox ID = txtpreComments runat = 服务器高度= 77px宽度= 326px
TextMode = MultiLine style = margin-left:96px; margin-bottom:23px >
< asp:Label ID = Label3 runat = server Text = 标签 >
< asp:TextBox ID = txtcurComments runat = server高度= 74px宽度= 312px
TextMode = MultiLine style = margin-left:114px; margin-bottom:23px >
< / fieldset >

解决方案

< blockquote>请尝试如下。



注意:这只是一个例子。根据你的应用调整它。) />


 <   table     style   =  width:300px >  
< tr >
< td > < label for = 男性 > < / label > < ; / td >
< td > < 输入 type = text name = mName / > < / td >
< / tr >
< < span class =code-leadattribute> tr >
< td > < 标签 = female > < / label > < / td >
< td > < 输入 type = text 名称 = fName / > < / td >
< / tr >
< /标签le >





现场演示: JSFiddle


I want to diplay label like this with textbox




Label ______________________________#
|
|
|
|
|
|
_______________________________#
This is the code Snippet

<fieldset class="fldset">
              <legend>Comments</legend>
                <asp:Label ID="Label1" runat="server" Text="Label" >
              <asp:TextBox ID="txtpreComments" runat="server" Height="77px" Width="326px"  
                    TextMode="MultiLine" style="margin-left: 96px; margin-bottom:23px">
                <asp:Label ID="Label3" runat="server" Text="Label">
              <asp:TextBox ID="txtcurComments" runat="server" Height="74px" Width="312px"  
                    TextMode="MultiLine" style="margin-left: 114px; margin-bottom:23px">
             </fieldset>

解决方案

Please try is as below.

Note: This is just an example.Adjust it according to your app. :)

<table style="width:300px">
<tr>
  <td><label for="male">Male</label></td>
    <td><input type="text" name="mName"/></td>
  </tr>
    <tr>
  <td><label for="female">Female</label></td>
    <td><input type="text" name="fName"/></td>
  </tr>
</table>



LIVE DEMO : JSFiddle


这篇关于如何将标签与文本框高度对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆