473,396 Members | 1,789 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Center web page info

Mel
Does anyone know a way to center the info. on a webpage? I want my
web site to work like MySpace.com where the page content remains
centered when I resize the browser window. For the life of me I can't
figure out how to do it. I am desperate to figure it out today!
Please help!

FYI: I am referencing one master page file in all of my web pages.
The content of my pages are stored in one or more panel controls.

- Melissa
(Using Asp.net 2.0, Visual Basic, Windows XP Pro SP2)

Jun 21 '07 #1
11 3998
Open up Internet Explorer, click the View menu, select the Source menu item.

:-)

Honestly, I imagine they're applying CSS styles to DIV and TABLE tags, but
I'm not absolutely sure on that; I usually farm out that UI work to other
people and concentrate on the data/business layer.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~
Ben Rush
Microsoft .NET Consultant
http://www.ben-rush.net/blog
http://www.sideshowsystems.com
"Mel" <ML********@gmail.comwrote in message
news:11*********************@u2g2000hsc.googlegrou ps.com...
Does anyone know a way to center the info. on a webpage? I want my
web site to work like MySpace.com where the page content remains
centered when I resize the browser window. For the life of me I can't
figure out how to do it. I am desperate to figure it out today!
Please help!

FYI: I am referencing one master page file in all of my web pages.
The content of my pages are stored in one or more panel controls.

- Melissa
(Using Asp.net 2.0, Visual Basic, Windows XP Pro SP2)

Jun 21 '07 #2
"Mel" <ML********@gmail.comwrote in message
news:11*********************@u2g2000hsc.googlegrou ps.com...
I am desperate to figure it out today!
<asp:Panel ID="MyPanel" runat="server" HorizontalAlign="center">

</asp:Panel>

or

<div style="margin-left:auto;margin-right:auto;">

</div>
--
http://www.markrae.net

Jun 21 '07 #3
Mel
On Jun 21, 10:26 am, "Ben Rush" <ben@sideshowsystemsDOTcomwrote:
Open up Internet Explorer, click the View menu, select the Source menu item.

:-)

Honestly, I imagine they're applying CSS styles to DIV and TABLE tags, but
I'm not absolutely sure on that; I usually farm out that UI work to other
people and concentrate on the data/business layer.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~
Ben Rush
Microsoft .NET Consultanthttp://www.ben-rush.net/bloghttp://www.sideshowsystems.com

"Mel" <MLights...@gmail.comwrote in message

news:11*********************@u2g2000hsc.googlegrou ps.com...
Does anyone know a way to center the info. on a webpage? I want my
web site to work like MySpace.com where the page content remains
centered when I resize the browser window. For the life of me I can't
figure out how to do it. I am desperate to figure it out today!
Please help!
FYI: I am referencing one master page file in all of my web pages.
The content of my pages are stored in one or more panel controls.
- Melissa
(Using Asp.net 2.0, Visual Basic, Windows XP Pro SP2)- Hide quoted text -

- Show quoted text -
Yep the source is what I have been sifting through. It doesn't make
much sense to me though. It's sort of like reading greek. I have
tried a few things but I thought someone could point me in the right
direction.

Jun 21 '07 #4
Mel
On Jun 21, 10:30 am, "Mark Rae" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message

news:11*********************@u2g2000hsc.googlegrou ps.com...
I am desperate to figure it out today!

<asp:Panel ID="MyPanel" runat="server" HorizontalAlign="center">

</asp:Panel>

or

<div style="margin-left:auto;margin-right:auto;">

</div>

--http://www.markrae.net
Thank you for the quick response. I tried the
HorizontalAlign="center" and it didn't work when I looked at it with
Internet Explorer. Am I missing something else?
This is the code for my top panel (on the master page). Basically the
top panel is aligned at the top of the window and it just has our logo
in the center and labels on each side.
<asp:Panel ID="pnlTop" runat="server" HorizontalAlign="center"
BackColor="Black" Height="94px" Style="z-index: 100;
left: 0px; position: absolute; top: 0px;" Width="850px">
<asp:Label ID="lblWelcome" runat="server"
BackColor="Transparent" BorderStyle="None"
Font-Names="Verdana" Font-Size="Medium"
ForeColor="#E0E0E0" Height="14px"
Style="z-index: 100; left: 10px; position: absolute;
top: 11px" Text="Welcome:"></asp:Label>
&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;
&nbsp; &nbsp;&nbsp;
<asp:Label ID="lblRepFirm" runat="server" Style="z-index:
106; left: 96px; position: absolute;
top: 39px; text-align: left;" Text="Label"
Width="219px" BackColor="Black" Font-Names="Verdana" Font-Size="Small"
ForeColor="White"></asp:Label>
<asp:Label ID="lblRepCity" runat="server"
BackColor="Black" Font-Names="Verdana"
Font-Size="Small" ForeColor="White" Style="z-index:
102; left: 96px; position: absolute;
top: 62px; text-align: left;" Text="Label"
Width="119px"></asp:Label>
<asp:Label ID="lblRepSt" runat="server" BackColor="Black"
Font-Names="Verdana"
Font-Size="Small" ForeColor="White" Style="z-index:
103; left: 224px; position: absolute;
top: 62px; text-align: left;" Text="Label"></
asp:Label>
<asp:Image ID="imgLogo" runat="server" Height="73px"
ImageUrl="~/Images/logo_unaclad.gif"
Style="z-index: 104; left: 318px; position: absolute;
top: 9px" Width="197px" />
<asp:Label ID="lblUName" runat="server" BackColor="Black"
Font-Names="Verdana"
Font-Size="Small" ForeColor="White" Height="22px"
Style="z-index: 105; left: 96px;
position: absolute; top: 11px; text-align: left;"
Width="167px"></asp:Label>
</asp:Panel>

Jun 21 '07 #5
"Mel" <ML********@gmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
I tried the HorizontalAlign="center" and it didn't work
left: 0px; position: absolute; top: 0px;"
And that's the reason... :-)
--
http://www.markrae.net

Jun 21 '07 #6
Mel
On Jun 21, 12:02 pm, "Mark Rae" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message

news:11*********************@g4g2000hsf.googlegrou ps.com...
I tried the HorizontalAlign="center" and it didn't work
left: 0px; position: absolute; top: 0px;"

And that's the reason... :-)

--http://www.markrae.net
Okay. So if I had an image on the panel how would I center the image
on the panel?

Jun 21 '07 #7
what is wrong with old
<center><img src=.....></center>

George
"Mel" <ML********@gmail.comwrote in message
news:11**********************@q69g2000hsb.googlegr oups.com...
On Jun 21, 12:02 pm, "Mark Rae" <m...@markNOSPAMrae.netwrote:
>"Mel" <MLights...@gmail.comwrote in message

news:11*********************@g4g2000hsf.googlegro ups.com...
I tried the HorizontalAlign="center" and it didn't work
left: 0px; position: absolute; top: 0px;"

And that's the reason... :-)

--http://www.markrae.net

Okay. So if I had an image on the panel how would I center the image
on the panel?

Jun 21 '07 #8
re:
!what is wrong with old
!<center><img src=.....></center>

The center element was deprecated in HTML 4.01.
The center element is not supported in XHTML 1.0 Strict DTD.

You should use CSS styles to center text and/or images.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"George Ter-Saakov" <gt****@cardone.comwrote in message
news:Os**************@TK2MSFTNGP02.phx.gbl...
what is wrong with old
<center><img src=.....></center>

George
"Mel" <ML********@gmail.comwrote in message
news:11**********************@q69g2000hsb.googlegr oups.com...
>On Jun 21, 12:02 pm, "Mark Rae" <m...@markNOSPAMrae.netwrote:
>>"Mel" <MLights...@gmail.comwrote in message

news:11*********************@g4g2000hsf.googlegr oups.com...

I tried the HorizontalAlign="center" and it didn't work
left: 0px; position: absolute; top: 0px;"

And that's the reason... :-)

--http://www.markrae.net

Okay. So if I had an image on the panel how would I center the image
on the panel?

Jun 21 '07 #9
"George Ter-Saakov" <gt****@cardone.comwrote in message
news:Os**************@TK2MSFTNGP02.phx.gbl...
what is wrong with old
<center><img src=.....></center>
Because the <centertag has been deprecated for ages...

If you use this sort of outdated stuff you really can have no guarantee that
modern browsers will display it correctly.

Use proper XHTML-compliant syntax, and you can be pretty sure that they
will...
--
http://www.markrae.net

Jun 21 '07 #10
Well, from my experience any browser supports <center>
the CSS stlyles.... not so much...
George.
"Mark Rae" <ma**@markNOSPAMrae.netwrote in message
news:uA**************@TK2MSFTNGP02.phx.gbl...
"George Ter-Saakov" <gt****@cardone.comwrote in message
news:Os**************@TK2MSFTNGP02.phx.gbl...
>what is wrong with old
<center><img src=.....></center>

Because the <centertag has been deprecated for ages...

If you use this sort of outdated stuff you really can have no guarantee
that modern browsers will display it correctly.

Use proper XHTML-compliant syntax, and you can be pretty sure that they
will...
--
http://www.markrae.net

Jun 22 '07 #11
"George Ter-Saakov" <gt****@cardone.comwrote in message
news:Oe**************@TK2MSFTNGP02.phx.gbl...
Well, from my experience any browser supports <center>
the CSS stlyles.... not so much...
You can either live in the past or keep up to date with modern technology...
--
http://www.markrae.net

Jun 22 '07 #12

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

Similar topics

0
by: PayPal | last post by:
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <STYLE type=text/css> ..dummy {} BODY, TD {font-family:...
2
by: googley | last post by:
I'm starting a new thread for a problem that I ran into.. I'm trying to use STYLE SHEETS/CSS to update multiple table widths across many pages. I did get it working with one small problem that...
3
by: Mike | last post by:
Another complaint I would like to see corrected. The Information Center tool is now pretty much useless to me. Does anyone else besides me remember when information center had a troubleshooting tab...
2
by: Claude Shea | last post by:
Is DB2 Development Center an addon product that I have to download or purchase separately? I can't seem to find it in any of my downloads or on any of my CDs. Is it available for all versions of...
7
by: ALI-R | last post by:
Hi All, I have two user controls (header and footer) ,,which I've placed in an HTML Table in a page.I set the **align="center"** in the table and the table still is on the left side of the page...
1
by: judacris | last post by:
I've seen the threads here about molding 2 divs in a centered fashion. but I can't seem to solve this thing. my blogger blog is functioning well on my site for now, but the blog feed (left) and...
4
by: DiamondEagle | last post by:
Is there a way to center the following div without using the <center> tags? <body bgcolor="#FFFFFF"> <center> <div id="Test" style="background-color:#000000; color:#ffffff; width: 80%;...
2
by: David | last post by:
I'm trying to style a kind of minimalist welcome page where each of X number of (gray?) boxes will be links to a part of the site. I want to implement the navbar (ie, set of boxes linking to...
7
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.