Problem with panel with absolute position

D

Dimitris Milonas

Hello all,

A short description of the problem is: an order for a panel to contain other
components then it must have absolute position. If the panel does not have
absolute position then it cannot serve as a container for other components!
Is there a way to solve the problem?

A full description of the problem is: I have a panel that I want to position
it on the page by using CSS. With the following CSS code I can position the
panel at the center of the page.

body
{
margin: 0px;
padding: 0px;
}

..PnlCont
{
margin: 0px auto;
padding: 0px;
}

The problem is that the previous CSS code does not work when the panel has
postion: absolute (like in the following declaration) but with the ability
to contain other components

<asp:panel ID="Panel1" runat="server" Height="50px" Style="z-index: 100;
position: absolute" Width="125px" CssClass="PnlCont">


The previous CSS code works only if the th panel does not have position:
absolute (like the follongdeclaration), but in this case it cannot contain
other components.

<asp:panel ID="Panel1" runat="server" Height="50px" Style="z-index: 100"
Width="125px" CssClass="PnlCont">

Is there a way to solve the problem?

Regards
Dimitris
 
J

Jon

Hello all,

A short description of the problem is: an order for a panel to contain other
components then it must have absolute position. If the panel does not have
absolute position then it cannot serve as a container for other components!
Is there a way to solve the problem?

A full description of the problem is: I have a panel that I want to position
it on the page by using CSS. With the following CSS code I can position the
panel at the center of the page.

body
{
margin: 0px;
padding: 0px;

}

.PnlCont
{
margin: 0px auto;
padding: 0px;

}

The problem is that the previous CSS code does not work when the panel has
postion: absolute (like in the following declaration) but with the ability
to contain other components

<asp:panel ID="Panel1" runat="server" Height="50px" Style="z-index: 100;
position: absolute" Width="125px" CssClass="PnlCont">

The previous CSS code works only if the th panel does not have position:
absolute (like the follongdeclaration), but in this case it cannot contain
other components.

<asp:panel ID="Panel1" runat="server" Height="50px" Style="z-index: 100"
Width="125px" CssClass="PnlCont">

Is there a way to solve the problem?

Regards
Dimitris

Hello mate.

I had a css problem the other day and I posted it too a CSS newsgroup
and they were a great help. If no one can help here, try there.

Jon
http://www.nantwichonline.com/placestovisit.aspx
All things Nantwich
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Dimitris said:
Hello all,

A short description of the problem is: an order for a panel to contain other
components then it must have absolute position. If the panel does not have
absolute position then it cannot serve as a container for other components!
Is there a way to solve the problem?

That's not correct. The element only has to have the position property
specified, it doesn't have to be set to absolute.
A full description of the problem is: I have a panel that I want to position
it on the page by using CSS. With the following CSS code I can position the
panel at the center of the page.

body
{
margin: 0px;
padding: 0px;
}

.PnlCont
{
margin: 0px auto;
padding: 0px;
}

The problem is that the previous CSS code does not work when the panel has
postion: absolute (like in the following declaration) but with the ability
to contain other components

<asp:panel ID="Panel1" runat="server" Height="50px" Style="z-index: 100;
position: absolute" Width="125px" CssClass="PnlCont">


The previous CSS code works only if the th panel does not have position:
absolute (like the follongdeclaration), but in this case it cannot contain
other components.

<asp:panel ID="Panel1" runat="server" Height="50px" Style="z-index: 100"
Width="125px" CssClass="PnlCont">

Is there a way to solve the problem?

Regards
Dimitris

Set the postion property to relative, and your element can both be
positioned using margin and contain positioned elements.
 
D

Dimitris Milonas

Thank you Göran.

Göran Andersson said:
That's not correct. The element only has to have the position property
specified, it doesn't have to be set to absolute.


Set the postion property to relative, and your element can both be
positioned using margin and contain positioned elements.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top