why is a particular div being centered?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • yawnmoth

    why is a particular div being centered?



    The div with red background is being centered and I don't know why.
    Any ideas?

    I'd like for it to be on the left...
  • rf

    #2
    Re: why is a particular div being centered?


    "yawnmoth" <terra1024@yaho o.comwrote in message
    news:cc545886-26d5-4d67-ba08-cc7bdb6fcc2c@q7 0g2000hsb.googl egroups.com...

    >
    The div with red background is being centered and I don't know why.
    Any ideas?
    It's not being centred. It is stacking up to the right of that input field
    because you have floated both of them left. Well, rather, the input field is
    inside a div that is floated left. If you look real close you will note that
    the top of the red div is above (and to the right) of the input field.

    The clear: right on the div that contains your offending red div has no
    effect on prior left floated elements.

    This is some bizarre mark up. You should study up on what float really
    means.

    --
    Richard.


    Comment

    • Beauregard T. Shagnasty

      #3
      Re: why is a particular div being centered?

      rf wrote:
      "yawnmoth" wrote:
      >... Any ideas?
      >
      This is some bizarre mark up. You should study up on what float really
      means.
      And it's using an XHTML doctype, but written in HTML. :-/

      --
      -bts
      -Friends don't let friends drive Vista

      Comment

      • yawnmoth

        #4
        Re: why is a particular div being centered?

        On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
        <a.nony.m...@ex ample.invalidwr ote:
        rf wrote:
        "yawnmoth" wrote:
        ... Any ideas?
        >
        This is some bizarre mark up. You should study up on what float really
        means.
        >
        And it's using an XHTML doctype, but written in HTML. :-/
        Here's a fun little experiment. Take this page:



        Perfectly valid XHTML according to validator.w3.or g. Now view that
        page in Firefox and save it as HTML. eg. File -Save Page As. Open
        the resultant page and look at it. You'll see it's no longer valid
        XHTML. And take a look at the junk it adds to the body background css
        property.

        So I do apologize for not using valid XHTML. I also apologize for
        using Firefox to save a page in an attempt to isolate the problem. Oh
        well. RIP Firefox.

        *sigh*

        Comment

        • Ben Bacarisse

          #5
          Re: why is a particular div being centered?

          yawnmoth <terra1024@yaho o.comwrites:
          On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
          <a.nony.m...@ex ample.invalidwr ote:
          >rf wrote:
          "yawnmoth" wrote:
          >... Any ideas?
          >>
          This is some bizarre mark up. You should study up on what float really
          means.
          >>
          >And it's using an XHTML doctype, but written in HTML. :-/
          >
          Here's a fun little experiment. Take this page:
          >

          >
          Perfectly valid XHTML according to validator.w3.or g. Now view that
          page in Firefox and save it as HTML. eg. File -Save Page As. Open
          the resultant page and look at it. You'll see it's no longer valid
          XHTML. And take a look at the junk it adds to the body background css
          property.
          Not here. What changes when you do it?

          --
          Ben.

          Comment

          • Jonathan N. Little

            #6
            Re: why is a particular div being centered?

            yawnmoth wrote:
            On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
            <a.nony.m...@ex ample.invalidwr ote:
            >rf wrote:
            >>"yawnmoth" wrote:
            >>>... Any ideas?
            >>This is some bizarre mark up. You should study up on what float really
            >>means.
            >And it's using an XHTML doctype, but written in HTML. :-/
            >
            Here's a fun little experiment. Take this page:
            >

            >
            Perfectly valid XHTML according to validator.w3.or g. Now view that
            page in Firefox and save it as HTML. eg. File -Save Page As. Open
            the resultant page and look at it. You'll see it's no longer valid
            XHTML. And take a look at the junk it adds to the body background css
            property.
            But served as text/html

            Date: Fri, 22 Feb 2008 17:34:47 GMT
            Server: WebServerX
            Last-Modified: Fri, 22 Feb 2008 17:02:25 GMT
            Etag: "131834b-18b-47bf0021"
            Accept-Ranges: bytes
            Content-Length: 395
            Content-Type: text/html

            200 OK

            --
            Take care,

            Jonathan
            -------------------
            LITTLE WORKS STUDIO

            Comment

            • David Stone

              #7
              Re: why is a particular div being centered?

              In article
              <1b8ef567-7571-4f4d-8397-c5ec971061bd@71 g2000hse.google groups.com>,
              yawnmoth <terra1024@yaho o.comwrote:
              On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
              <a.nony.m...@ex ample.invalidwr ote:
              rf wrote:
              "yawnmoth" wrote:
              >... Any ideas?
              This is some bizarre mark up. You should study up on what float really
              means.
              And it's using an XHTML doctype, but written in HTML. :-/
              >
              Here's a fun little experiment. Take this page:
              >

              >
              Perfectly valid XHTML according to validator.w3.or g. Now view that
              page in Firefox and save it as HTML. eg. File -Save Page As. Open
              the resultant page and look at it. You'll see it's no longer valid
              XHTML. And take a look at the junk it adds to the body background css
              property.
              What version of FireFox did you use? I get exactly the same page
              back every time I save the above URL with FireFox 2.0.0.12,
              whether I save the page directly or view the source first and
              then save.
              So I do apologize for not using valid XHTML. I also apologize for
              using Firefox to save a page in an attempt to isolate the problem. Oh
              well. RIP Firefox.
              [Misquote]
              I don't think you saved what you thought you were saving...
              [/Misquote]

              Comment

              • yawnmoth

                #8
                Re: why is a particular div being centered?

                On Feb 22, 11:35 am, "Jonathan N. Little" <lws4...@centra l.netwrote:
                yawnmothwrote:
                On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
                <a.nony.m...@ex ample.invalidwr ote:
                rf wrote:
                >"yawnmoth" wrote:
                >>... Any ideas?
                >This is some bizarre mark up. You should study up on what float really
                >means.
                And it's using an XHTML doctype, but written in HTML. :-/
                >
                Here's a fun little experiment. Take this page:
                >>
                Perfectly valid XHTML according to validator.w3.or g. Now view that
                page in Firefox and save it as HTML. eg. File -Save Page As. Open
                the resultant page and look at it. You'll see it's no longer valid
                XHTML. And take a look at the junk it adds to the body background css
                property.
                >
                But served as text/html
                >
                Date: Fri, 22 Feb 2008 17:34:47 GMT
                Server: WebServerX
                Last-Modified: Fri, 22 Feb 2008 17:02:25 GMT
                Etag: "131834b-18b-47bf0021"
                Accept-Ranges: bytes
                Content-Length: 395
                Content-Type: text/html
                >
                200 OK
                Hmmm. That seems like a likely culprit. I know with CSS, Firefox
                won't treat it as CSS unless the Content-Type is text/css. mod_mime
                (I think) will set the Content-Type automatically to that if the
                extension is *.css, but if it's *.php or whatever, you'll have to set
                it, yourself. Here's an example:



                I tried, incidentally, using a meta tag to set the Content-Type to
                text/xhtml but I'm still getting HTML when I save. I guess I'll need
                to create an .htaccess rule or something, but I'm somewhat hesitant to
                do that, because not all the *.html's I have actually are XHTML. Some
                really are HTML.

                Seems like I probably ought to post this on mozillazine.org ...

                Comment

                • Beauregard T. Shagnasty

                  #9
                  Re: why is a particular div being centered?

                  yawnmoth wrote:
                  >"Beauregard T. Shagnasty" wrote:
                  >rf wrote:
                  >>"yawnmoth" wrote:
                  >>>... Any ideas?
                  >>
                  >>This is some bizarre mark up. You should study up on what float really
                  >>means.
                  >>
                  >And it's using an XHTML doctype, but written in HTML. :-/
                  >
                  Here's a fun little experiment. Take this page:
                  >

                  >
                  Perfectly valid XHTML according to validator.w3.or g.
                  The above page is not valid.
                  Now view that page in Firefox and save it as HTML. eg. File -Save
                  Page As. Open the resultant page and look at it. You'll see it's no
                  longer valid XHTML. And take a look at the junk it adds to the body
                  background css property.
                  >
                  So I do apologize for not using valid XHTML. I also apologize for
                  using Firefox to save a page in an attempt to isolate the problem.
                  Oh well. RIP Firefox.
                  Why would you want to use a browser to save pages? View the source and
                  paste it into your text editor instead. Keep the browser; it's a good
                  one.

                  --
                  -bts
                  -Motorcycles defy gravity; cars just suck

                  Comment

                  • yawnmoth

                    #10
                    Re: why is a particular div being centered?

                    On Feb 22, 11:49 am, David Stone <no.em...@domai n.invalidwrote:
                    In article
                    <1b8ef567-7571-4f4d-8397-c5ec97106...@71 g2000hse.google groups.com>,
                    >
                    >
                    >
                    yawnmoth<terra1 ...@yahoo.comwr ote:
                    On Feb 22, 6:16 am, "Beauregard T. Shagnasty"
                    <a.nony.m...@ex ample.invalidwr ote:
                    rf wrote:
                    "yawnmoth" wrote:
                    ... Any ideas?
                    >
                    This is some bizarre mark up. You should study up on what float really
                    means.
                    >
                    And it's using an XHTML doctype, but written in HTML. :-/
                    >
                    Here's a fun little experiment. Take this page:
                    >>
                    Perfectly valid XHTML according to validator.w3.or g. Now view that
                    page in Firefox and save it as HTML. eg. File -Save Page As. Open
                    the resultant page and look at it. You'll see it's no longer valid
                    XHTML. And take a look at the junk it adds to the body background css
                    property.
                    >
                    What version of FireFox did you use? I get exactly the same page
                    back every time I save the above URL with FireFox 2.0.0.12,
                    whether I save the page directly or view the source first and
                    then save.
                    >
                    So I do apologize for not using valid XHTML. I also apologize for
                    using Firefox to save a page in an attempt to isolate the problem. Oh
                    well. RIP Firefox.
                    >
                    [Misquote]
                    I don't think you saved what you thought you were saving...
                    [/Misquote]
                    I've been saving as "Web Page, complete". I just tried to save as
                    "Web Page, HTML only" and got the exact same page (instead of the
                    Firefox altered one). Maybe someone could confirm?

                    Comment

                    • Bergamot

                      #11
                      Re: why is a particular div being centered?

                      yawnmoth wrote:
                      >
                      I tried, incidentally, using a meta tag to set the Content-Type to
                      text/xhtml but I'm still getting HTML when I save.
                      Of course you will. It uses whatever MIME type you have set for .html on
                      your local PC. Whatever it was on the remote server is irrelevant at
                      this point. A meta tag won't do anything to change that on your local
                      system, either. You won't get an XHTML content type unless you view it
                      through a local web server with the proper configuration.

                      --
                      Berg

                      Comment

                      • Bergamot

                        #12
                        Re: why is a particular div being centered?

                        yawnmoth wrote:
                        >
                        I've been saving as "Web Page, complete". I just tried to save as
                        "Web Page, HTML only" and got the exact same page (instead of the
                        Firefox altered one).
                        "Web Page complete" is altered so all the file references (<imgetc)
                        will work correctly once it's downloaded to your local drive. There may
                        be other changes as well but I've never bothered looking at them.
                        Regardless, it is not intended to be identical to the remote page.

                        If you want the page in it's unaltered state, View Source the online
                        page and save *that*.

                        --
                        Berg

                        Comment

                        Working...