Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   centering page (http://www.velocityreviews.com/forums/t164828-centering-page.html)

Bob 04-16-2006 03:35 AM

centering page
 
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"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Title</title>
<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;
}

div.top {
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;
}
</style>

</head>

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

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

</body>
</html>



Neredbojias 04-16-2006 04:37 AM

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

> How can I center the whole container in IE its is centered in firefox
> ....(snip markup)


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

--
Neredbojias
Infinity can have limits.

Els 04-16-2006 06:40 AM

Re: centering page
 
Bob wrote:

> 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"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


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:
http://locusmeus.com/html-css/centeringpage.html

--
Els http://locusmeus.com/

Thomas Jollans 04-16-2006 09:33 AM

Re: centering page
 
Els wrote:

> Bob wrote:
>
>> 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"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

>
> 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:
> http://locusmeus.com/html-css/centeringpage.html
>


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 - http://jollybox.de/
GNU/Linux - freedom, functionality, power - what more do you want ?
When in doubt, follow the penguins.

Els 04-16-2006 10:48 AM

Re: centering page
 
Thomas Jollans wrote:
> Els wrote:
>> Bob wrote:
>>
>>> 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"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

>>
>> Take out the <?xml ... line and IE will be in Standards mode

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


I didn't say IE made sense ;-)

--
Els http://locusmeus.com/

Alan J. Flavell 04-16-2006 10:50 AM

Re: centering page
 
On Sun, 16 Apr 2006, Thomas Jollans wrote:

> Els wrote:
>
> >> <?xml version="1.0" encoding="utf-8" ?>
> >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

> >
> > 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:
> > http://locusmeus.com/html-css/centeringpage.html

>
> you mean a line that has a rightful place in every *standard* XHTML
> document


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
circumstances.

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

http://www.w3.org/TR/2002/REC-xhtml1-20020801/#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:

http://www.w3.org/TR/2002/REC-xhtml1-20020801/#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
languages).

> throws a browser into quirks mode ?! that makes no sence...


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
HTML/4.01(strict).

have fun

Martin Jay 04-16-2006 12:21 PM

Re: centering page
 
In message <4441bb3e$1@dnews.tpgi.com.au>, Bob <null@?.?.invalid> writes
>How can I center the whole container in IE its is centered in firefox


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

To fix that use:

body{
text-align: center;
}

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

David 04-16-2006 05:44 PM

Re: centering page
 

>>

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


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


All times are GMT. The time now is 05:08 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.