473,396 Members | 1,898 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to align label within margin of a panel?

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
2 11077
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Robert Nicholson | last post by:
So I've got one page where I have an image inside a DIV with text-align: center and the image is correctly centered in that block. Making me think that text-align will center the contents of a...
32
by: Axel Dahmen | last post by:
Hi, I'd like to align a <div> within the center of the visual canvas. The text within the div should be left-aligned. How can I possibly achieve this? So far I can only align text blocks...
3
by: Mark | last post by:
Ok, it is starting to get somewhere, but i am not sure what to do with the following problem: I designed "knobs". They are 90px in width and do have one border (right) of 1px. So i guess, within...
24
by: Mike Otten | last post by:
Any help greatly appreciated. The validated page is at: http://myweb.stedwards.edu/michaelo/ddtab.htm The trouble is with the radio buttons (2/3-down the left column). The radios are...
0
by: Siva | last post by:
Hi, I am designing a page in asp.net. I am facing problem with placing the image box and the hyperlinks inside the panels. I am not able to align / place it inside the panel. My page contains...
2
by: Wilfried Mestdagh | last post by:
Hi, I want to add a Label on a panel programatically. No problem. But I can't seems to manage that the label is centered horizontal and vertical in the panel. I experimented with TextAlign and...
2
by: swapna_munukoti | last post by:
Hi all, I am new to asp.net. So, may be my question may be simple. But I am feeling hard to achieve this. I need to create a web custom label control, for which I have to assign new property...
3
by: smitb | last post by:
Hi, I am a CSS/HTML novice. Can anyone please answer my question. I am trying to insert a small image(an arrow) within an <li> tag. My problem is that I cannot right align the image. Here is...
2
Ciary
by: Ciary | last post by:
hi fellow coders, i'm not sure if this is the right place to ask since it's rather specific. i've got some questions using EXT JS. i've been asking on there forum but i didn't get a reply...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.