Re: Cannot control the width of the label control
- From: "Nathan Sokalski" <njsokalski@xxxxxxxxxxx>
- Date: Mon, 3 Sep 2007 19:38:26 -0400
I once had that problem too, and I found that the problem is that the
element must also be a block element. To solve your problem, add the
following attribute:
style="display:inline-block;"
This will solve your problem. I add this attribute to many of my Label
controls when creating input forms, because it is more efficient than making
a table if you only have a few fields (not to mention specifying the
dimensions of table cells has given me more frustration than any other
layout aspect). Good Luck!
--
Nathan Sokalski
njsokalski@xxxxxxxxxxx
http://www.nathansokalski.com/
"BobLaughland" <peter.mcclymont@xxxxxxxxx> wrote in message
news:1188861094.435908.171190@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi There,
I am trying to get some fields to align on a web page, like this,
To:
From:
Subject:
Each of the fields above have a corresponding asp:Textbox control next
to it that I cannot get to lign up. I have this code,
<asp:Label Runat="server" Width="100px" ID="Label6">To: </
asp:Label>
<asp:TextBox ID="Textbox1" Runat="server" Width="200px" />
<asp:Label Runat="server" ID="Label7" ForeColor=red Width="5px">*</
asp:Label>
So that means I have tried to tell it that I want the asp:label
control to be 100 pixels wide, but it seems to shrink the label width
to fit the text.
Please help.
.
- Follow-Ups:
- Re: Cannot control the width of the label control
- From: BobLaughland
- Re: Cannot control the width of the label control
- References:
- Cannot control the width of the label control
- From: BobLaughland
- Cannot control the width of the label control
- Prev by Date: autocomplete=off is not XHTML compliant
- Next by Date: Re: autocomplete=off is not XHTML compliant
- Previous by thread: Cannot control the width of the label control
- Next by thread: Re: Cannot control the width of the label control
- Index(es):
Relevant Pages
|