Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Positioning a Div in the center of the Page


Message #1 by "Ganesh Ramamurthy" <r_ganesh76@h...> on Thu, 13 Feb 2003 07:19:31
Dear All,

I am using an HTML label (Div) in my application. I want to position it in 
the center of the page. How can I do that from my C# code.

How can i get the width and height of the parent browser window??

Please help

Regards
Ganesh
Message #2 by "Rod McLeay" <r.mcleay@c...> on Thu, 13 Feb 2003 15:18:34 +0800
Ganesh,

I think you can do that with tables and HTML.

<body>
<table width=3D"100%" height=3D"100%">
	<tr valign=3D"middle">
		<td align=3D"center"><div><h1>HELLO</h1></div></td>
	</tr>
</table>
</body>

Rod

-----Original Message-----
From: Ganesh Ramamurthy [mailto:r_ganesh76@h...]
Sent: Thursday, 13 February 2003 3:20 PM
To: ASP.NET
Subject: [aspx] Positioning a Div in the center of the Page

Dear All,

I am using an HTML label (Div) in my application. I want to position it 
in
the center of the page. How can I do that from my C# code.

How can i get the width and height of the parent browser window??

Please help

Regards
Ganesh
Message #3 by "Rod McLeay" <r.mcleay@c...> on Thu, 13 Feb 2003 15:30:53 +0800
Sorry Ganesh,
Ignor that my last reply.
In retrespect I guess you have more to go on the page than just a div 
tag.
Rod
-----Original Message-----
From: Rod McLeay
Sent: Thursday, 13 February 2003 3:19 PM
To: ASP.NET
Subject: [aspx] RE: Positioning a Div in the center of the Page

Ganesh,

I think you can do that with tables and HTML.

<body>
<table width=3D"100%" height=3D"100%">
	<tr valign=3D"middle">
		<td align=3D"center"><div><h1>HELLO</h1></div></td>
	</tr>
</table>
</body>

Rod

-----Original Message-----
From: Ganesh Ramamurthy [mailto:r_ganesh76@h...]
Sent: Thursday, 13 February 2003 3:20 PM
To: ASP.NET
Subject: [aspx] Positioning a Div in the center of the Page

Dear All,

I am using an HTML label (Div) in my application. I want to position it 
in
the center of the page. How can I do that from my C# code.

How can i get the width and height of the parent browser window??

Please help

Regards
Ganesh

Message #4 by "Alex Smotritsky" <alex.smotritsky@v...> on Thu, 13 Feb 2003 02:26:18 -0500
I don't know about doing it from c#, but what about
<center><div></div></center>


-----Original Message-----
From: Ganesh Ramamurthy [mailto:r_ganesh76@h...] 
Sent: Thursday, February 13, 2003 7:20 AM
To: ASP.NET
Subject: [aspx] Positioning a Div in the center of the Page


Dear All,

I am using an HTML label (Div) in my application. I want to position it
in 
the center of the page. How can I do that from my C# code.

How can i get the width and height of the parent browser window??

Please help

Regards
Ganesh

Message #5 by "Michal Tesar" <kariba@p...> on Thu, 13 Feb 2003 08:44:16 -0700
Will this help?

<style type="text/css">
.CheckLayoutAddressHead{position: <%= try center, here%>;left: <%=%>px;top:
<%=%>px;z-index: 1;}
</style>

<DIV id="LayoutAddressHead" class="LayoutAddressHead">
<span class="TextHeadingAddress">
<xsl:value-of select="Layout/@LayoutAddressHead"/>
</span>
</DIV>

I don't know if this helps,

cheers,
Mike

-----Puvodní zpráva-----
Od: Ganesh Ramamurthy [mailto:r_ganesh76@h...]
Odesláno: Thursday, February 13, 2003 7:20 AM
Komu: ASP.NET
Predmet: [aspx] Positioning a Div in the center of the Page


Dear All,

I am using an HTML label (Div) in my application. I want to position it in
the center of the page. How can I do that from my C# code.

How can i get the width and height of the parent browser window??

Please help

Regards
Ganesh

Message #6 by "Michal Tesar" <kariba@p...> on Thu, 13 Feb 2003 08:46:24 -0700
Will this help?

<style type="text/css">
.LayoutAddressHead{position: <%= try center, here%>;left:
<%=%>px;top:<%=%>px;z-index: 1;}
</style>

<DIV id="LayoutAddressHead" class="LayoutAddressHead">
<span class="TextHeadingAddress">
<xsl:value-of select="Layout/@LayoutAddressHead"/>
</span>
</DIV>

I don't know if this helps,

cheers,
Mike

-----Puvodní zpráva-----
Od: Ganesh Ramamurthy [mailto:r_ganesh76@h...]
Odesláno: Thursday, February 13, 2003 7:20 AM
Komu: ASP.NET
Predmet: [aspx] Positioning a Div in the center of the Page


Dear All,

I am using an HTML label (Div) in my application. I want to position it in
the center of the page. How can I do that from my C# code.

How can i get the width and height of the parent browser window??

Please help

Regards
Ganesh


  Return to Index