Page centered in IE7 but not in FF2.0

Discussion in 'HTML' started by a-ok-site, Nov 13, 2007.

  1. a-ok-site

    a-ok-site Guest

    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
     
    a-ok-site, Nov 13, 2007
    #1
    1. Advertisements

  2. a-ok-site

    richard Guest

    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.
     
    richard, Nov 13, 2007
    #2
    1. Advertisements

  3. Unless you changed it since posting, it is the same for me in several
    browsrers.
    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;
     
    Beauregard T. Shagnasty, Nov 13, 2007
    #3
  4. 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.
     
    André Gillibert, Nov 13, 2007
    #4
  5. a-ok-site

    a-ok-site Guest

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

    Daniel
     
    a-ok-site, Nov 13, 2007
    #5
  6. a-ok-site

    richard Guest

    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".
     
    richard, Nov 14, 2007
    #6
  7. a-ok-site

    rf Guest

    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.
     
    rf, Nov 14, 2007
    #7
  8. a-ok-site

    John L. Guest

    Using '.center' is fine because <center> is a deprecated presentational
    element and shouldn't be thought of as a tag at all.
     
    John L., Nov 14, 2007
    #8
  9. 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.
     
    Jukka K. Korpela, Nov 14, 2007
    #9
  10. 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.
    That's an argument in favor of designing with a pure text editor.
     
    André Gillibert, Nov 14, 2007
    #10
  11. a-ok-site

    Ben C Guest

    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"?)
     
    Ben C, Nov 14, 2007
    #11
  12. a-ok-site

    dorayme Guest

    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>
     
    dorayme, Nov 14, 2007
    #12
  13. Scripsit Ben C:
    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.
    In theory perhaps. There's no sign of anything like that happening in this
    century.
     
    Jukka K. Korpela, Nov 14, 2007
    #13
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.