Solved

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

Posted on 2006-11-22
11
235 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ASP.net VB.net hide footer cells of GridView 2 34
Problem to go to Web page 2 52
ASP.NET reading ATOM 2 27
Adjust the position 3 13
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

18 Experts available now in Live!

Get 1:1 Help Now