how to align label within margin of a panel?

  • Thread starter Thread starter Steve Richter
  • Start date Start date
S

Steve Richter

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
 
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)
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top