centering page

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
How can I center the whole container in IE its is centered in firefox

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
" ">
<html xmlns=" " lang="en" xml:lang="en">
<style type="text/css">

div {
  border: 1px solid #000000;

td {
  vertical-align: middle;
  text-align: center;

div.container {
  position: relative;
  margin: 0 auto;
  width: 770px;
  height: 600px;
  text-align: left;

div.left {
  position: absolute;
  top: 110px;
  left: 0px;
  width: 150px;
  height: 450px;
} {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 760px;
  height: 100px;
  text-align: center;

div.main {
  position: absolute;
  top: 110px;
  left: 150px;
  width: 610px;
  text-align: justify;
  height: 450px;


<!-- ... body of document ... -->
<div class="container">
  <div class="left">
    Left content

  <div class="top">
    Top content
  <div class="main">
    Main content


Re: centering page

To further the education of mankind, "Bob" <null> vouchsafed:

Quoted text here. Click to load it

I don't know, but I'll bet I'd find the answer easy with a url.

Infinity can have limits.

Re: centering page

Bob wrote:

Quoted text here. Click to load it

Take out the <?xml ... line and IE will be in Standards mode and it
will center your page like it does in Firefox.
That line throws it in Quirksmode. If you want to center it in
Quirksmode, use old IE5 method for centering:

Els            /

Re: centering page

Els wrote:

Quoted text here. Click to load it

you mean a line that has a rightful place in every *standard* XHTML document
throws a browser into quirks mode ?! that makes no sence...

Thomas Jollans - /
GNU/Linux - freedom, functionality, power - what more do you want ?
When in doubt, follow the penguins.

Re: centering page

Thomas Jollans wrote:
Quoted text here. Click to load it

I didn't say IE made sense ;-)

Els            /

Re: centering page

On Sun, 16 Apr 2006, Thomas Jollans wrote:

Quoted text here. Click to load it

But (even if that were true), you're not sending *standard* XHTML when
you send it as text/html; you're sending bad HTML, which just happens
to resemble XHTML/1.0 subject to Appendix C, and relying on known
browser (mis)behaviour to fix up the deliberate HTML errors.

IE has no idea what to do with real XHTML (application/xhtml+xml).  
Well, I've taught my IE to pass real XHTML across to Seamonkey for
rendering.  Not ideal, but better than merely offering to download it.

But the <?xml...> thingy is optional under certain circumstances, and
the present situation (where utf-8 is used) is surely one of those

That's fine for utf-8; now see what it says in section C.1:

- which is almost correct.  But this sentence:

|Remember, however, that when the XML declaration is not included in a
|document, the document can only use the default character encodings
|UTF-8 or UTF-16.

is inaccurate, and incompatible with the explanation in section C.9:

When sending via HTTP with a character encoding specified on the HTTP
Content-type header, then the HTTP value takes precedence (as section
C.9 rightly says), and there's no need to specify the encoding via the
<?xml...> thingy.  It doesn't /have/ to be utf-8 or utf-16. However,
this can lead to problems when saving the page, unmodified, to file,
and then attempting to browse it from file, by which time the HTTP
character encoding specification has been lost.

In short, it's safer to use utf-8 everywhere, rather than trying to
use one of the 8-bit encodings (such as iso-8859-1 for Latin-1

Quoted text here. Click to load it

IE does what it does.  It's your choice whether to adjust to that, or
just design for www-compatible browsers, and leave IE to its own
non-conforming behaviour.  In the current situation, the content *is*
still accessible (unlike some of the other IE faults, e.g the peekaboo
bug); a few cosmetic faults are only to be expected on a browser with
such a notorious history of non-conformance to the www interworking
specifications.  Your choice, really.

People are finally taking a deliberate decision about which browser to
use, instead of just plugging along with the operating system
component which came with their pee-cee.  Maybe you want to author for
discerning readers who were willing to make their own choice; maybe
you want to author for the unthinking masses who know nothing more
than "Open The Internet"; maybe you want to do your best for both - in
the end, it's your choice; we can't tell you what to want.

Personally, I'd recommend staying with HTML/4.01(strict) until it's
feasible to deploy real XHTML and get any real benefits from it.  
XHTML/1.0 Appendix C brings essentially no benefits (since it was
designed to be functionally identical to HTML/4.01, expressed in XHTML
syntax), and several problems.  Your internal process can perfectly
well be XML-based if you want to use XML-based tools, but for general
WWW purposes I would recommend publishing the result as valid

have fun

Re: centering page

Quoted text here. Click to load it

IE makes no sense!  Another good reason for standards and why all
browsers SHOULD follow them......

Re: centering page

Quoted text here. Click to load it

It appears to be centred okay here in IE6, however the layout is forced
left in IE5.5.

To fix that use:

        text-align: center;

This will centre everything in the document, so you will need to
'text-align: left' things such as <p>.
Martin Jay

Site Timeline