473,568 Members | 3,014 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Centere Panels

In ASP.NET 2.0 I have a number of pages with panels that I want horizontally
centered on the page.

These are currently rendered correctly in Internet Explorer and Opera and
incorrectly in Netscape, Mozilla, and Firefox. In these browsers they are
always left aligned.

What is the "trick" to get a panel horizontally centered in all five
browsers?

--
-- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd.
--

Jul 21 '06 #1
2 1116
try the code below and see if it works on those browsers.

Regards

John Timney (MVP)
<%@ Page Language="C#" Debug="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>
<meta http-equiv="content-type" content="text/html;charset=IS O-8859-1">
<title>Dead Centre Controls Example</title>
<style type="text/css" media="screen"> <!--
body
{
color: white;
background-color: white;
margin: 0px
}

#horizon
{
color: white;
background-color: transparent;
text-align: center;
position: absolute;
top: 50%;
left: 0px;
width: 100%;
height: 1px;
overflow: visible;
visibility: visible;
display: block
}

#content
{
font-family: Verdana, Geneva, Arial, sans-serif;
background-color: transparent;
margin-left: -125px;
position: absolute;
top: -35px;
left: 50%;
width: 250px;
height: 70px;
visibility: visible
}

....bodytext
{
font-size: 14px
}

....headline
{
font-weight: bold;
font-size: 24px
}

#footer
{
font-size: 11px;
font-family: Verdana, Geneva, Arial, sans-serif;
text-align: center;
position: absolute;
bottom: 0px;
left: 0px;
width: 100%;
height: 20px;
visibility: visible;
display: block
}

a:link, a:visited
{
color: #06f;
text-decoration: none
}

a:hover
{
color: red;
text-decoration: none
}

--></style>
</head>

<body>
<div id="horizon">
<div id="content">
<div class="bodytext ">

<body>

<form runat="server">
<aspPanel id="Panel1" runat="server"
style="padding: 15,15,15,15;
background-color:red;
border-color:black;bor der-width:1;
border-style:solid">

<asp:Label id="Label1"
Text="Some Centered Controls"
Font-Name="verdana"
Font-Size="12"
runat="server"/>

</aspPanel>
</form>
</div>
</div>
</div>

</body>

</html>
"Thom Little" <th**@tlanet.ne twrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
In ASP.NET 2.0 I have a number of pages with panels that I want
horizontally centered on the page.

These are currently rendered correctly in Internet Explorer and Opera and
incorrectly in Netscape, Mozilla, and Firefox. In these browsers they are
always left aligned.

What is the "trick" to get a panel horizontally centered in all five
browsers?

--
-- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd.
--

Jul 21 '06 #2
Thank you for the nifty idea.

As it turns out I needed to KISS it. The problem seems to be that the
browsers that were failing don't know what to do with a panel embedded in
another panel. My solution was to not embed it.

--
-- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd.
--

"John Timney (MVP)" <x_****@timney. eclipse.co.ukwr ote in message
news:K9******** *************** *******@eclipse .net.uk...
try the code below and see if it works on those browsers.

Regards

John Timney (MVP)

<SNIP>

Jul 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1507
by: PZ | last post by:
OSS 2005 The First International Conference on Open Source Systems Genova, July 11 - 15, 2005 CALL FOR PANELS http://oss2005.case.unibz.it Submissions of panels are solicited for the "First International Conference on Open Source Systems, OSS2005", to be held in Genova, Italy from the 11th to the 15th of July 2005.
0
1383
by: PZ | last post by:
OSS 2005 The First International Conference on Open Source Systems Genova, July 11 - 15, 2005 CALL FOR PANELS http://oss2005.case.unibz.it Submissions of panels are solicited for the "First International Conference on Open Source Systems, OSS2005", to be held in Genova, Italy from the 11th to the 15th of July 2005.
4
8088
by: BBM | last post by:
I'm trying to set up a form with two panels divided by a Splitter control. I can make the Splitter work in the situations described in the documentation (Listbox or TreeView on left w/Dock set to Left, Panel on right of form w/ Dock set to Fill, Splitter between them set w/ Dock set to Left. Works as advertised. But... if I change to have...
1
7653
by: pfnus | last post by:
Hi, I want to display different forms when the buttons are clicked and all the forms are having different controls on it. So instead of adding new windows forms to the project, i enlarged the form and used many panels on the same form, which i think is easier to manage. However, i am having problems. Should i need to put the panels on the...
3
2227
by: Jonas | last post by:
Hi! I have aspx-page where I use multiple panels to make room for more controls than would otherwise fit onto one page. On submit, the controls on all panels, visible or not, should be validated with the ASP.NET validators, and if the page is valid, it is sent to the database in one transaction. But it seems that only the controls on the...
1
2233
by: Demetri | last post by:
I'm trying to determine if we want to use panels or user controls for our pages. Our primary concern is performance, page loading and posting speed. To illustrate my question, lets use the Customer Orders scenario: Problem: User needs to view orders and and edit, add, save on one page called Orders.aspx. To begin with the page contains a...
0
1513
by: ohadasor | last post by:
Hello, I'm using .NET Framework 2.0. I'm creating several panels, one above the other, with splitters between them. I'm using Splitter and not SplitContainer, because the latter is such a big mess when you need to put splitters between more than two windows. To be more specific, my splitters and panels are like that: _ |_|
1
4774
by: Ben | last post by:
Hi We have a number of Panels on our windows form, we have controls inside and outside of the panels. I am having problems tabbing between controls, it appers to be when the controls are within panels: It will tab though the controls outside the panels and then, tab into the panels. I have also tried setting the tab index at design...
3
1864
by: Andrea Gasperi | last post by:
Hi there not sure if this is the right place but i'm proud to use for the first time the "Managed Newsgroups" feature of my brand new MSDN subscription :-) So here is the problem. I've configured a page with five panels that I use with the modal popup extender. This panels are nested in web controls. Page structure is not that simple but...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.