473,326 Members | 2,255 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,326 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 2095
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.