简体   繁体   English

HTML样式文字区域格式

[英]Html style text area format

Hai i want the text should come at the bottom of the cell but it showing in the middle. Hai,我希望文本应位于单元格的底部,但应显示在中间。 Please help me to solve this. 请帮我解决这个问题。 i typed valign="bottom" in td but then also not coming at the bottom of the cell. 我在td中输入了valign =“ bottom”,但是也没有出现在单元格的底部。

 <table cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td valign="bottom"  style="padding-left: 20px; background-color: Green">
                <div style="padding-top: 5px">
                    <div  style="float: left">
                        First Name
                    </div>
                    <div style="float: left; font-size: 11px; padding-top: 2px">
                        (as in passport)
                    </div>
                    <div style="float: left; color: Red; padding-left: 1px">
                        *
                    </div>
                </div>
            </td>
            <td valign="bottom" style="padding-left: 20px">
                <div style="padding-top: 5px">
                    <div  style="float: left">
                        Last Name
                    </div>
                    <div style="float: left; font-size: 10px">
                        (as in passport)
                    </div>
                    <div style="float: left; color: Red">
                        *
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td style="padding-left: 20px">
                <asp:TextBox ID="txtfname" runat="server" BackColor="#FFFEDF" Width="200px" ></asp:TextBox>
            </td>
            <td style="padding-left: 20px; padding-top: 0px">
                <asp:TextBox ID="txtlname" runat="server" BackColor="#FFFEDF" Width="200px" ></asp:TextBox>
            </td>
        </tr>
    </table>

You can add " position: relative; bottom: -3px; " to the div in the td's - it would just move them 3 px lower. 您可以在td的div中添加“ position: relative; bottom: -3px; ”-会将它们降低3 px。 Here's the fiddle: http://jsfiddle.net/BLTRx/ 这是小提琴: http : //jsfiddle.net/BLTRx/

Another possibility would be to make the small text being independent from the cell-content. 另一种可能性是使小文本独立于单元格内容。 The text would always stay at the same place: http://jsfiddle.net/h5Vzw/ 文本将始终留在同一位置: http : //jsfiddle.net/h5Vzw/

But I would recommend you to put the whole styling in an external stylesheet, and to avoid style-tags. 但是我建议您将整个样式放在外部样式表中,并避免使用样式标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM