how to align label within margin of a panel?

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
 
B

bruce barker

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

Steve Richter

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top