Solved

Floating panels (divs) appearing stacked  I want them side by side

Posted on 2006-11-22
11
240 Views
Last Modified: 2008-02-01
Can someone tell me why these would appear stacked at run-time as opposed to side by side?


<asp:Panel id="pnSubContainer" style="width:750px; BORDER-TOP-STYLE: solid; BORDER-RIGHT-STYLE: solid; BORDER-LEFT-STYLE: solid; BORDER-BOTTOM-STYLE: solid" Runat="server">
      <asp:Panel id="pnHomeModifications" style="FLOAT: left; Width=100px" Runat="server"></asp:Panel>
      <asp:Panel id="pnDurableMedical" style="FLOAT: left; Width=100px" Runat="server"></asp:Panel>
      <asp:Panel id="pnTransportation" style="FLOAT: left; Width=100px" Runat="server"></asp:Panel>
</asp:Panel>

in designmode they appear side by side.... and they definitly fit???   so what gives?
0
Comment
Question by:dbedoo
  • 7
  • 3
11 Comments
 
LVL 1

Author Comment

by:dbedoo
ID: 17996130
is height a factor?   my middle panel will be 1 row of text taller than the others but I didn't think that mattered
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17996267
The problem is with the outer div (id="pnSubContainer).

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17996281
I would try style="position:  absolute", and not FLOAT, if you just want to have 2 panels side-by-side.

Bob
0
 
LVL 11

Accepted Solution

by:
ethoths earned 250 total points
ID: 17996356
This appears stacked at design time and side by side at runtime for me.
            <asp:Panel id="pnSubContainer" style="width:750px; BORDER-TOP-STYLE: solid; BORDER-RIGHT-STYLE: solid; BORDER-LEFT-STYLE: solid; BORDER-BOTTOM-STYLE: solid" Runat="server">
                <asp:Panel id="pnHomeModifications" style="FLOAT: left; Width=100px" Runat="server">A</asp:Panel>
                <asp:Panel id="pnDurableMedical" style="FLOAT: left; Width=100px" Runat="server">B</asp:Panel>
                <asp:Panel id="pnTransportation" style="FLOAT: left; Width=100px" Runat="server">C</asp:Panel>
        </asp:Panel>

Replacing the outer panel with a div give me side by side in both design and run.

To be honest this is what I would expect since it is a known issue that VS does not display divs correctly at design time.



0
 
LVL 1

Author Comment

by:dbedoo
ID: 17996362
What is the problem with the outer div ethoths?   specifics?  I did this same exact thing with divs in html and it works fine ...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:dbedoo
ID: 17996367
sorry I spoke too soon
0
 
LVL 1

Author Comment

by:dbedoo
ID: 17996393
Yeah I dont care about design time ... if it would appear correctly during run time is all that matters.  But you say that its runs side by side for you?    weird ... it doesn't for me ...  stacked every time?
0
 
LVL 1

Author Comment

by:dbedoo
ID: 17996438
I fill the content of the panels in server side codebehind... would that effect the order of rendering these panels?
0
 
LVL 11

Expert Comment

by:ethoths
ID: 17996472
Not sure about the outer div - Probably a VS bug.

My advice is to look at the source code. What gets rendered in the browser is the important thing. panels should be rendered as simple divs and the positioning and layout depends on the css settings. Do you have other divs on the page? Do you have style setting in other css files taht might be affecting this?

0
 
LVL 1

Author Comment

by:dbedoo
ID: 17996761
yes there are other divs on the page ... but this one(pnSubContainer) is not nested within them.  The only thing that could be throwing it off are the tables Im rendering inside the divs via server side vb. which do have css stuff.  Ill take it out and see what happens.
0
 
LVL 1

Author Comment

by:dbedoo
ID: 17996902
That was it ....  stupid mistake ...  it was .css thing I was doing inside one of the tables....  thanks for the help :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now