Page centered in IE7 but not in FF2.0

A

a-ok-site

I am in the process of trying to build a template for my web site
using only CSS, but when it is viewed with IE7 it is centered, but
with Firefox 2.0 it is floated left. I really don't mind which way it
is but I would like it to be the same across browsers. Does anybody
have a suggestion or cure? Any help will be appreciated! The url is a-
ok-site.com.

Thanks,

Daniel
 
R

richard

I am in the process of trying to build a template for my web site
using only CSS, but when it is viewed with IE7 it is centered, but
with Firefox 2.0 it is floated left. I really don't mind which way it
is but I would like it to be the same across browsers. Does anybody
have a suggestion or cure? Any help will be appreciated! The url is a-
ok-site.com.

Thanks,

Daniel

One thing you might try is to simply use <center> before your first
division and close it with </center>.

Your javascript should also be in a seperate file as your css is.
 
B

Beauregard T. Shagnasty

a-ok-site said:
I am in the process of trying to build a template for my web site
using only CSS, but when it is viewed with IE7 it is centered, but
with Firefox 2.0 it is floated left.

Unless you changed it since posting, it is the same for me in several
browsrers.
I really don't mind which way it is but I would like it to be the same
across browsers. Does anybody have a suggestion or cure? Any help
will be appreciated! The url is:

http://a-ok-site.com/ <-- please post URLs in this format

You will want to correct a bug .. the IE resizing bug.

body { ...
font-family: arial,comic sans ms,technical;
font-size: 1.0em;

Change the size from 1.0em to 100%

You should also assign a fallback font (and Comic Sans MS needs quotes
around it, and both it and Technical are poor choices). I would
recommend:

font-family: Tahoma, "Trebuchet MS", Helvetica, Arial, sans-serif;
 
A

André Gillibert

a-ok-site said:
I am in the process of trying to build a template for my web site
[...]

Why the h*ll did you use this awful script (on said:
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);

This has the effect of reloading the page in Netscape 4.x (and no other
browser) when the browser window is resized. This is totally useless as
the reloaded page is identical to the previous one.
 
A

a-ok-site

a-ok-site said:
I am in the process of trying to build a template for my web site
[...]

Why the h*ll did you use this awful script (on said:
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);

This has the effect of reloading the page in Netscape 4.x (and no other
browser) when the browser window is resized. This is totally useless as
the reloaded page is identical to the previous one.

Thanks DW MX was helping and I didn't know any better. It's out of
there.

Daniel
 
R

richard

One thing I noticed that should you stay away from is using the same name
for both class and ID divisions. ID is supposed to unique and can only be
used once per page.

You show <div class="center"> as well as <div id="center">.
It is also not a good idea to use "tag words" as names. If you insist, use
something like "acenter" and "bcenter".
 
R

rf

André Gillibert said:
a-ok-site said:
I am in the process of trying to build a template for my web site
[...]

Why the h*ll did you use this awful script (on said:
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);

This has the effect of reloading the page in Netscape 4.x (and no other
browser) when the browser window is resized. This is totally useless as
the reloaded page is identical to the previous one.

This is to fix a bug in some netscape version from way back in last century.
NS3 or 4 IIRC. It would not repaint the canvas correctly after a resize.

Such cargo cult stuff is one of the prime indicators of Dreamweaver. Along
with javascript rollovers instead of CSS.
 
J

John L.

richard said:
You show <div class="center"> as well as <div id="center">.
It is also not a good idea to use "tag words" as names. If you insist, use
something like "acenter" and "bcenter".

Using '.center' is fine because <center> is a deprecated presentational
element and shouldn't be thought of as a tag at all.
 
J

Jukka K. Korpela

Scripsit John L.:

That was clueless, not unexpectedly considering the posting history.
Using '.center' is fine because <center> is a deprecated
presentational element and shouldn't be thought of as a tag at all.

That wasn't much better. You give advice on HTML in public but cannot even
distinguish between elements and tags. Moreover, using "center" as a class
name is basically as presentational as <center> or <div align="center">.
Actually the so-called deprecated markup alternatives are better because
they are more honest: the say, in HTML, what presentational effect is
desired, whereas class="center" assigns just a class name, with no meaning
defined in HTML, and not suggestive of _semantics_ to a human reader.
 
A

André Gillibert

rf said:
message


This is to fix a bug in some netscape version from way back in last
century.
NS3 or 4 IIRC. It would not repaint the canvas correctly after a resize.
The page doesn't raise layout bugs that could be solved by reloading with
NS4.7 or NS4.08.
(I tested it)
So, the script is most probably useless.
Such cargo cult stuff is one of the prime indicators of Dreamweaver.
Along
with javascript rollovers instead of CSS.

That's an argument in favor of designing with a pure text editor.
 
B

Ben C

Scripsit John L.:


That was clueless, not unexpectedly considering the posting history.


That wasn't much better. You give advice on HTML in public but cannot even
distinguish between elements and tags. Moreover, using "center" as a class
name is basically as presentational as <center> or <div align="center">.
Actually the so-called deprecated markup alternatives are better because
they are more honest: the say, in HTML, what presentational effect is
desired, whereas class="center" assigns just a class name, with no meaning
defined in HTML, and not suggestive of _semantics_ to a human reader.

I'm all in favour of honesty, but <center> and align="center" are
perhaps less likely to be supported in newer and/or future browsers
(surely that's part of the sense of "deprecated"?)
 
D

dorayme

Ben C said:
I'm all in favour of honesty, but <center> and align="center" are
perhaps less likely to be supported in newer and/or future browsers
(surely that's part of the sense of "deprecated"?)

Apart from the deprecation issue, however important:

If a list is wanted to be styled to centre in a container, and
<center> is used to do it, or it is styled in css to so center,
the normal sighted viewer of a web page is no wiser either way.

If a screen reader is involved, I am hazy on what happens in
respect to the difference?

If someone reads the actual html source, and does not read the
css, then it could be said that they are equally informed by the
use of <div class="center;"> as by
<center><div>...</div></center>. In other words, against all good
practice, it would clue up the reader with no need to see the
css.

If best practice was used and the class was based on need to so
style all such elements - e.g. class="outsideLinks" then the
human who did not look at the actual css would know at least and
at most that all such classes have some style or other. Still not
as singularly meaningful as <center>.

If a name, according to best practice, is given to an element
that does not conjure up the style but only the function of the
element itself and there are no other instances of this class -
the exercise being done purely formally to follow good practice -
then, once again, <center> and <div class="center"...>... would
have been more meaningful.

I think I will stop now, I am getting nowhere. But it was a break
from removing the millions of spots and things on the poster I am
restoring. <g>
 
J

Jukka K. Korpela

Scripsit Ben C:
I'm all in favour of honesty, but <center> and align="center" are
perhaps less likely to be supported in newer and/or future browsers

Now and in the foreseeable future, they surely take effect more often than
the CSS counterpart, since the latter will be ignored when CSS is disabled.
Whether this is a good thing depends on the purpose and context. Few authors
realize that it's _good_ to be easily overridable.
(surely that's part of the sense of "deprecated"?)

In theory perhaps. There's no sign of anything like that happening in this
century.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top