By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,938 Members | 1,584 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,938 IT Pros & Developers. It's quick & easy.

how to align label within margin of a panel?

P: n/a
I want my panel to have an inner margin. Problem is label text does
not appear to recognize the margin. In this example, the TextBox
aligns on the margin, the label does not:

<asp:Panel id="Panel1" runat="server"
BackColor="gainsboro"
Scrollbars=Both Style="margin:25px;"
Height="200px"
Width="300px">

Panel1: Here is some static content...
<br />

<asp:Label Text="Label 1" runat=server />
<br />
<asp:TextBox ID=TextBox1 runat=server />
</asp:Panel>

What is the correct HTML/CSS way to get text to recognize the margin
of a div?

thanks,

-Steve

May 22 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
a div's margin is outside its content area and border. what you want to
set is padding.

style="padding:25px;"
or set the margin of the label.
-- bruce (sqlwork.com)

Steve Richter wrote:
I want my panel to have an inner margin. Problem is label text does
not appear to recognize the margin. In this example, the TextBox
aligns on the margin, the label does not:

<asp:Panel id="Panel1" runat="server"
BackColor="gainsboro"
Scrollbars=Both Style="margin:25px;"
Height="200px"
Width="300px">

Panel1: Here is some static content...
<br />

<asp:Label Text="Label 1" runat=server />
<br />
<asp:TextBox ID=TextBox1 runat=server />
</asp:Panel>

What is the correct HTML/CSS way to get text to recognize the margin
of a div?

thanks,

-Steve
May 22 '07 #2

P: n/a
On May 22, 3:53 pm, bruce barker <nos...@nospam.comwrote:
a div's margin is outside its content area and border. what you want to
set is padding.

style="padding:25px;"

or set the margin of the label.

-- bruce (sqlwork.com)
thanks.

May 23 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.