473,586 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange effect with panel

Hi all,

I have...

<asp:Panel id=SignInPanel runat="server" borderwidth="1p x"
bordercolor="Bl ack" borderstyle="So lid">

<div class=row><asp: label id=BadPasswordL abel runat="server" Visible="False"
forecolor="red" ></asp:label><br>< font size=2><strong> &nbsp;Sign
in:</strong></font></div>
<div class=row><span class=label>Mem bership Number / Email address:</span>
<span class=formfield s><asp:TextBox id=MembershipTe xtBox
runat="server"> </asp:TextBox></span></div>
<div class=row><span class=label>Pas sword:</span<span
class=formfield s><asp:TextBox id=PasswordText Box runat="server"
TextMode="Passw ord"></asp:TextBox></span></div>
<div class=row><span class=label</span><span class=formfield s><asp:Button
id=SignInButton runat="server" Text="Sign In"></asp:Button></span></div>

</asp:Panel>
My styles are...
<style type="text/css">
DIV.row { CLEAR: both; FONT-SIZE: 9pt; PADDING-TOP: 3px; FONT-FAMILY:
verdana }
DIV.row SPAN.label { FLOAT: left; WIDTH: 250px; TEXT-ALIGN: right }
DIV.row SPAN.formfields { FLOAT: right; WIDTH: 190px; TEXT-ALIGN: left }
</style>
For some reason, my SignInButton appears on the outside of the box. I have
had this on other parts of the project as well, but I don't understand what
is going on.

Any ideas?

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
May 30 '07 #1
2 1316
Hi David,

The problem here is the use of the "float" style. Because the "float" style
causes an element to "float," it is positioned, and removed from the normal
flow of the document. The "float" style indicates the direction that the
element should float, and any in-line non-positioned element to the opposite
side will flow around the box. However, any non-positioned block elements
next to the floated element will flow vertically as if the floated element
did not exist. This includes the div containing the elements.

The div with the class "row" contains the floated elements, but is
non-positioned, which means that it participates in the normal flow. Because
the elements inside it are positioned using "float," they do not participate
in normal flow. Therefore, the div itself behaves as if it were empty,
collapsing to the default line-height. Using the "clear" style on the
containing div is unnecessary, because it is neither to the right or left of
the elements inside it. It surrounds (contains) them. The scope of the
floating elements is confined to their container.

The "row" divs are not positioned, so they flow normally with regards to one
another, and as block elements they fill the available width of the line,
and flow underneath each other.

The solution is fairly simple:

DIV.row { FONT-SIZE: 9pt; PADDING-TOP: 3px; FONT-FAMILY:
verdana; height: 20px; margin: 1px;}

I removed the "clear" style, which was superfluous. I added a "height"
style, which is the height of the tallest floated elements inside the div.
This results in no spaces between these tallest elements in successive rows.
I could have simply made the "height" style larger, but as it is fairly
obvious that you are emulating a table, I emulated border spacing by
assigning a margin of 1 px to each "row" div.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"David" <da************ *****@revilloc. REMOVETHIS.comw rote in message
news:un******** ******@TK2MSFTN GP04.phx.gbl...
Hi all,

I have...

<asp:Panel id=SignInPanel runat="server" borderwidth="1p x"
bordercolor="Bl ack" borderstyle="So lid">

<div class=row><asp: label id=BadPasswordL abel runat="server"
Visible="False" forecolor="red" ></asp:label><br>< font
size=2><strong> &nbsp;Sign in:</strong></font></div>
<div class=row><span class=label>Mem bership Number / Email address:</span>
<span class=formfield s><asp:TextBox id=MembershipTe xtBox
runat="server"> </asp:TextBox></span></div>
<div class=row><span class=label>Pas sword:</span<span
class=formfield s><asp:TextBox id=PasswordText Box runat="server"
TextMode="Passw ord"></asp:TextBox></span></div>
<div class=row><span class=label</span><span
class=formfield s><asp:Button id=SignInButton runat="server" Text="Sign
In"></asp:Button></span></div>

</asp:Panel>
My styles are...
<style type="text/css">
DIV.row { CLEAR: both; FONT-SIZE: 9pt; PADDING-TOP: 3px; FONT-FAMILY:
verdana }
DIV.row SPAN.label { FLOAT: left; WIDTH: 250px; TEXT-ALIGN: right }
DIV.row SPAN.formfields { FLOAT: right; WIDTH: 190px; TEXT-ALIGN: left }
</style>
For some reason, my SignInButton appears on the outside of the box. I have
had this on other parts of the project as well, but I don't understand
what is going on.

Any ideas?

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available

May 31 '07 #2
Thanks Kevin,

Being a developer rather than a designer, there are many parts to CSS that
still elude me.

I have temporarily got around the issue by adding a couple of BR tags just
after the button, but I do take onboard what you say and will implement it.

You are correct. I was trying to implement a table without using tables. I
am "old school" as in I still use tables for positioning normally, but most
clients now want spans and divs instead of tables, so I have to bite the
bullet and learn it.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Kevin Spencer" <un**********@n othinks.comwrot e in message
news:OK******** ******@TK2MSFTN GP02.phx.gbl...
Hi David,

The problem here is the use of the "float" style. Because the "float"
style causes an element to "float," it is positioned, and removed from the
normal flow of the document. The "float" style indicates the direction
that the element should float, and any in-line non-positioned element to
the opposite side will flow around the box. However, any non-positioned
block elements next to the floated element will flow vertically as if the
floated element did not exist. This includes the div containing the
elements.

The div with the class "row" contains the floated elements, but is
non-positioned, which means that it participates in the normal flow.
Because the elements inside it are positioned using "float," they do not
participate in normal flow. Therefore, the div itself behaves as if it
were empty, collapsing to the default line-height. Using the "clear" style
on the containing div is unnecessary, because it is neither to the right
or left of the elements inside it. It surrounds (contains) them. The scope
of the floating elements is confined to their container.

The "row" divs are not positioned, so they flow normally with regards to
one another, and as block elements they fill the available width of the
line, and flow underneath each other.

The solution is fairly simple:

DIV.row { FONT-SIZE: 9pt; PADDING-TOP: 3px; FONT-FAMILY:
verdana; height: 20px; margin: 1px;}

I removed the "clear" style, which was superfluous. I added a "height"
style, which is the height of the tallest floated elements inside the div.
This results in no spaces between these tallest elements in successive
rows. I could have simply made the "height" style larger, but as it is
fairly obvious that you are emulating a table, I emulated border spacing
by assigning a margin of 1 px to each "row" div.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"David" <da************ *****@revilloc. REMOVETHIS.comw rote in message
news:un******** ******@TK2MSFTN GP04.phx.gbl...
>Hi all,

I have...

<asp:Panel id=SignInPanel runat="server" borderwidth="1p x"
bordercolor="B lack" borderstyle="So lid">

<div class=row><asp: label id=BadPasswordL abel runat="server"
Visible="False " forecolor="red" ></asp:label><br>< font
size=2><strong >&nbsp;Sign in:</strong></font></div>
<div class=row><span class=label>Mem bership Number / Email
address:</span<span class=formfield s><asp:TextBox id=MembershipTe xtBox
runat="server" ></asp:TextBox></span></div>
<div class=row><span class=label>Pas sword:</span<span
class=formfiel ds><asp:TextBox id=PasswordText Box runat="server"
TextMode="Pass word"></asp:TextBox></span></div>
<div class=row><span class=label</span><span
class=formfiel ds><asp:Button id=SignInButton runat="server" Text="Sign
In"></asp:Button></span></div>

</asp:Panel>
My styles are...
<style type="text/css">
DIV.row { CLEAR: both; FONT-SIZE: 9pt; PADDING-TOP: 3px; FONT-FAMILY:
verdana }
DIV.row SPAN.label { FLOAT: left; WIDTH: 250px; TEXT-ALIGN: right }
DIV.row SPAN.formfields { FLOAT: right; WIDTH: 190px; TEXT-ALIGN: left }
</style>
For some reason, my SignInButton appears on the outside of the box. I
have had this on other parts of the project as well, but I don't
understand what is going on.

Any ideas?

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available


May 31 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2328
by: Martin Drautzburg | last post by:
In the wx demoy TreeCtrl.py I find the following code, that should have no effect but seems to be needed nevertheless. class TestTreeCtrlPanel(wx.Panel): def __init__(self, parent, log): , isz) fldridx = il.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER, wx.ART... self.tree.SetImageList(il)
0
894
by: Marc Robitaille | last post by:
Hello group I have a strange problem. I have a panel. On this panel, I can drop custom Textbox that I create at runtime. I have a toolbar on witch a delete button exist. When I click on this button, the application delete the select Textbox on the panel. I allso give the ability to the Texbox to contains others Textbox. That mean that...
1
1786
by: sternchen | last post by:
Hi, I read all threads to this topic which were exactly like my problem and I tried all solutions but it still doesnt want to work :(. Can anybody help? I wrote an application where you can create your own graph by adding curve points into a coordinate system grid. I create a Panel and draw everything on it. Also you can pick the...
2
4272
by: kulabhishek | last post by:
Hello all. I have developed one user control "Grid" in C# and I am using it in another user control inside one panel. The AutoScroll property for the panel is enabled. When the height or width of "Grid" increases and becomes more than panel size, scrollbars of panel are enabled. When I scroll using any scrollbar and click on the...
0
7912
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6614
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.