473,396 Members | 1,765 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.

Items aligning left instead of centering

Hello monsters of CSS. I was wondering if you could help me with a
layout problem.

Here's a test page that demonstrates the problem:

http://64.142.13.246/ls/test.htm

(I've given the DIVs height and color to make it obvious what contains
what. In the evenual working application they would be invisible.)

In IE, the div with id "centerContainer" (dark grey) is properly
centered in the document window. In Mozilla, that div is aligned left,
bringing everything it contains over to the left.

The CSS styles are embedded in the document for convenience here, but
normally I'd import them.

Any help with this would be greatly appreciated!

Thanks,

Phester

Jul 20 '05 #1
2 2101
On Sun, 26 Oct 2003 00:53:33 GMT, Phester
<ph*****@nonexistenthost.com> wrote:
Hello monsters of CSS. I was wondering if you could help me with a
layout problem.

Here's a test page that demonstrates the problem:

http://64.142.13.246/ls/test.htm

(I've given the DIVs height and color to make it obvious what contains
what. In the evenual working application they would be invisible.)

In IE, the div with id "centerContainer" (dark grey) is properly
centered in the document window.

[...]

Actually, IE is in error. It appears that you have given the
surrounding container (<div id="pageWide">) the declaration of
"text-align: center" to try to center the <div id="centeredContainer">
within it. Actually, that is not supposed to center a block, but
rather, it should center inline content such as text. What you should
do is set the left and right margins of the #centeredContainer to
"auto" which will center a block in conforming browsers such as
Mozilla.

For more details, see:

<http://theodorakis.net/blockcenter.html>

Nick

--
Nick Theodorakis
ni**************@hotmail.com
nicholas_theodorakis [at] urmc [dot] rochester [dot] edu
Jul 20 '05 #2
Nick Theodorakis wrote:
On Sun, 26 Oct 2003 00:53:33 GMT, Phester
<ph*****@nonexistenthost.com> wrote:

Hello monsters of CSS. I was wondering if you could help me with a
layout problem.

Here's a test page that demonstrates the problem:

http://64.142.13.246/ls/test.htm

(I've given the DIVs height and color to make it obvious what contains
what. In the evenual working application they would be invisible.)

In IE, the div with id "centerContainer" (dark grey) is properly
centered in the document window.


[...]

Actually, IE is in error. It appears that you have given the
surrounding container (<div id="pageWide">) the declaration of
"text-align: center" to try to center the <div id="centeredContainer">
within it. Actually, that is not supposed to center a block, but
rather, it should center inline content such as text. What you should
do is set the left and right margins of the #centeredContainer to
"auto" which will center a block in conforming browsers such as
Mozilla.

For more details, see:

<http://theodorakis.net/blockcenter.html>

Nick


Thanks a lot. That's a huge help. I haven't had time to try it out yet,
but I will and I'll check out your article.

Phester

Jul 20 '05 #3

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

Similar topics

2
by: Phester | last post by:
Hello monsters of CSS. I was wondering if you could help me with a layout problem. Here's a test page that demonstrates the problem: http://64.142.13.246/ls/test.htm (I've given the DIVs...
3
by: CJM | last post by:
I want to create a footer with 3 items, one of which will always stay to the left, one will be in the centre, and the 3rd will be at the right. As you might imagine, I want the Right & Centre items...
18
by: Chris | last post by:
Hello, I have an unordered list with 3 levels, like this: <ul class="normalList"> <li>blabla</li> <ul> <li>blabla</li> </ul> <li>blabla</li> <ul>
7
by: Scott Teglasi | last post by:
Hi all, I was curious as to how others whom have dealt with this problem have handled it. The problem is that I have a site design of a fixed width and height and want to center that content...
2
by: Dave | last post by:
Hello all, I need to know if you can vertically align Items within an ItemTemplate. For example I have two columns, one column has a stack of 6 textboxes, my second column can have 1 to n...
0
by: pflynn | last post by:
I need to center the text in a div within its natural width (ie the width of the longest line) and then place that div on the RH side of the window. <div id="#ident"> <div id="#address"> ...
2
by: rudicheow | last post by:
SHORT VERSION ============= I have a bunch of identical fixed-size single-celled tables that rest against each other horizontally thanks to "float:left". These tables are dynamically generated...
4
by: Greg Scharlemann | last post by:
I'm having difficulty getting the radio buttons to align vertically with one another and the header (1 2 3 4 5) at the top. Ideally each radio button will be directly below the one above it and...
2
by: agbee1 | last post by:
Hello: I've finally made the effort to ween myself from overly using tables and use CSS for my positioning. However, I am having a problem with my navigational menu properly aligning in Firefox,...
14
by: gaijinco | last post by:
I was a hobbist web coder for years but I had to sidestep for a while. Now I'm trying to return to it and I'm trying to clarify how am I supposed to do somethings with CSS v.s. HTML and I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
0
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...

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.