8 Replies Latest reply on Apr 26, 2006 3:41 PM by Newsgroup_User

    Depreciated "center" tag - alternatives?

    Level 7
      Hi all

      I'm trying to centre three images in a div [thats all three images are in
      one div] and it works beautifully using div align=center BUT it doesn't
      validate because the center tag is depreciated.

      Do you know how I can centre these images using "legal" markup?

      The page in question is www.patriotsarms.co.uk/headerMain.php and the images
      are the three icons on the top right.

      The site is a work in progress so be gentle with me )

      Thanks
      Judi


        • 1. Re: Depreciated "center" tag - alternatives?
          Level 7
          Judi

          > works beautifully using div align=center BUT it doesn't
          > validate because the center tag is depreciated.
          >
          > Do you know how I can centre these images using "legal"
          > markup?

          CSS to the rescue.

          <div style="width: 400px; margin-left: auto; margin-right:
          auto;">content here</div>


          David
          stiller (at) quip (dot) net
          Dev essays: http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Depreciated &quot;center&quot; tag - alternatives?
            Level 7
            set the CSS on the div to text-align:center


            --
            Nancy Gill
            Adobe Community Expert
            BLOG: http://www.dmxwishes.com/blog.asp
            Author: Dreamweaver 8 e-book for the DMX Zone
            Co-Author: Dreamweaver MX: Instant Troubleshooter (August, 2003)
            Technical Editor: DMX 2004: The Complete Reference, DMX 2004: A Beginner's
            Guide, Mastering Macromedia Contribute
            Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP Web Development


            "Judith Kruger" <jakabout@yahoo.co.uk> wrote in message
            news:e2ofui$c2q$1@forums.macromedia.com...
            > Hi all
            >
            > I'm trying to centre three images in a div [thats all three images are in
            > one div] and it works beautifully using div align=center BUT it doesn't
            > validate because the center tag is depreciated.
            >
            > Do you know how I can centre these images using "legal" markup?
            >
            > The page in question is www.patriotsarms.co.uk/headerMain.php and the
            > images are the three icons on the top right.
            >
            > The site is a work in progress so be gentle with me )
            >
            > Thanks
            > Judi
            >


            • 3. Re: Depreciated &quot;center&quot; tag - alternatives?
              Level 7
              > set the CSS on the div to text-align:center

              Aha! Yes, that might be what the OP was after. "text-align: center;"
              centers the contents of the div, while "margin-left: auto; margin-right:
              auto;" centers the div itself in relation to its parent -- which doesn't
              really *look* centered unless the div's width is smaller than its parent's.


              David
              stiller (at) quip (dot) net
              Dev essays: http://www.quip.net/blog/
              "Luck is the residue of good design."


              • 4. Re: Depreciated &quot;center&quot; tag - alternatives?
                Level 7
                Thanks! Perfect. It works. I didn't realise you could use the text-align
                property to align images.....

                Thanks again
                Judi

                "Nancy *ACE*" <nancy@webwish.com> wrote in message
                news:e2ogm0$d3f$1@forums.macromedia.com...
                > set the CSS on the div to text-align:center
                >
                >
                > --
                > Nancy Gill
                > Adobe Community Expert
                > BLOG: http://www.dmxwishes.com/blog.asp
                > Author: Dreamweaver 8 e-book for the DMX Zone
                > Co-Author: Dreamweaver MX: Instant Troubleshooter (August, 2003)
                > Technical Editor: DMX 2004: The Complete Reference, DMX 2004: A
                > Beginner's
                > Guide, Mastering Macromedia Contribute
                > Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP Web
                > Development
                >
                >
                > "Judith Kruger" <jakabout@yahoo.co.uk> wrote in message
                > news:e2ofui$c2q$1@forums.macromedia.com...
                >> Hi all
                >>
                >> I'm trying to centre three images in a div [thats all three images are in
                >> one div] and it works beautifully using div align=center BUT it doesn't
                >> validate because the center tag is depreciated.
                >>
                >> Do you know how I can centre these images using "legal" markup?
                >>
                >> The page in question is www.patriotsarms.co.uk/headerMain.php and the
                >> images are the three icons on the top right.
                >>
                >> The site is a work in progress so be gentle with me )
                >>
                >> Thanks
                >> Judi
                >>
                >
                >


                • 5. Re: Depreciated &quot;center&quot; tag - alternatives?
                  Level 7
                  What's an "OP" ?

                  Yes, your advice is good for aligning the div itself but not the contents in
                  the div unless the div is the content.... but you said that, didn't
                  you...;o)


                  "David Stiller" <stiller-NO-SPAM-@quip.net> wrote in message
                  news:e2ogq4$d7m$1@forums.macromedia.com...
                  >> set the CSS on the div to text-align:center
                  >
                  > Aha! Yes, that might be what the OP was after. "text-align: center;"
                  > centers the contents of the div, while "margin-left: auto; margin-right:
                  > auto;" centers the div itself in relation to its parent -- which doesn't
                  > really *look* centered unless the div's width is smaller than its
                  > parent's.
                  >
                  >
                  > David
                  > stiller (at) quip (dot) net
                  > Dev essays: http://www.quip.net/blog/
                  > "Luck is the residue of good design."
                  >


                  • 6. Re: Depreciated &quot;center&quot; tag - alternatives?
                    Level 7
                    Judi

                    > What's an "OP" ?

                    Short for "original poster"; in this case, you. From your name,
                    it's relatively obvious you're a she, but I think people use "OP" to keep
                    from using the wrong pronoun and also because some people's names on the
                    forum are too long to remember. Yours isn't, but habits are sometimes hard
                    to break.


                    David
                    stiller (at) quip (dot) net
                    Dev essays: http://www.quip.net/blog/
                    "Luck is the residue of good design."


                    • 7. Re: Depreciated &quot;center&quot; tag - alternatives?
                      Level 7
                      Ta David.

                      "David Stiller" <stiller-NO-SPAM-@quip.net> wrote in message
                      news:e2ohl7$e64$1@forums.macromedia.com...
                      > Judi
                      >
                      >> What's an "OP" ?
                      >
                      > Short for "original poster"; in this case, you. From your name,
                      > it's relatively obvious you're a she, but I think people use "OP" to keep
                      > from using the wrong pronoun and also because some people's names on the
                      > forum are too long to remember. Yours isn't, but habits are sometimes
                      > hard to break.
                      >
                      >
                      > David
                      > stiller (at) quip (dot) net
                      > Dev essays: http://www.quip.net/blog/
                      > "Luck is the residue of good design."
                      >


                      • 8. Re: Depreciated &quot;center&quot; tag - alternatives?
                        Level 7
                        text-align:center only centers the inline contents of the div.

                        --
                        Murray --- ICQ 71997575
                        Adobe Community Expert
                        (If you *MUST* email me, don't LAUGH when you do so!)
                        ==================
                        http://www.dreamweavermx-templates.com - Template Triage!
                        http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                        http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                        http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                        ==================


                        "David Stiller" <stiller-NO-SPAM-@quip.net> wrote in message
                        news:e2ogq4$d7m$1@forums.macromedia.com...
                        >> set the CSS on the div to text-align:center
                        >
                        > Aha! Yes, that might be what the OP was after. "text-align: center;"
                        > centers the contents of the div, while "margin-left: auto; margin-right:
                        > auto;" centers the div itself in relation to its parent -- which doesn't
                        > really *look* centered unless the div's width is smaller than its
                        > parent's.
                        >
                        >
                        > David
                        > stiller (at) quip (dot) net
                        > Dev essays: http://www.quip.net/blog/
                        > "Luck is the residue of good design."
                        >