Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Position: absolute
Message
 
To
24/06/2007 19:48:51
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01235268
Message ID:
01235291
Views:
12
I'd advise staying away from position:absolute unless it's for overlay content. As soon as you make something absolute it quits flowing with the rest of the document and it rarely yields proper results unless you truly want something pinned to a fixed position...

As to your specific layout I'd stick to tables if you need to have side by side content. Just create an HTML table with a single row and two columns as a wrapper around your panels and you'll be all set.

Another way that works in many situation is to use the float:right CSS tag. You can define the right panel first and set its float:right, then render the second panel *AFTER* it. That works too but can get weird when there's not enough room to contain both panels side by side.

+++ Rick ---



>My master page:
>**************************************************************************
>
>< %@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" % >
>
><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
><html xmlns="http://www.w3.org/1999/xhtml" >
><head runat="server">
>    <title>Untitled Page</title>
>    <link rel="stylesheet" type="text/css" href="App_Themes/StyleSheet_01.css" />
></head>
><body>
>    <form id="form1" runat="server">
>     <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" />
>     <div class="none"><a href="#maincontent">skip to the main content area of this page</a></div>
>        <div id="nav-main">
>                   <asp:Menu ID="MainMenu" runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal"
>                Width="400px" ForeColor="White" CssClass="menu-main" MaximumDynamicDisplayLevels="0" StaticSelectedStyle-CssClass="StaticSelectedStyle" />
>            <div>
>                 </div>
>        </div>
>        <a id="maincontent"></a>
>        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
>        </asp:contentplaceholder>
>
>    </form>
></body>
></html>
>*********************************************************End Master Page
>My Content page:
>*********************************************************Start Content Page
>< %@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" Theme="MainTheme" title="Untitled Page" % >
><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
>    <asp:Button ID="Button1" runat="server" Text="Show Style" Width="124px" /> 
>
>    <asp:Panel ID="Panel1" runat="server" Height="322px" Width="291px" BackColor="blue">
>        Panel 1 is this one here</asp:Panel>
>    <asp:Panel   ID="Panel2"  runat="server" BackColor="Orange" style="top:109px; left:300px; position: absolute" Height="322px" Width="291px">
>        Panel 2 is this one here</asp:Panel>
>
>    </asp:Content>
>*************************************************** End Content Page
>
>My Question is this
>My goal is to place "Panel2" on the right side of "Panel1". There must be some way to set the "Top" attribute to equal the top of the "Content Place Holder"?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform