Loading ...
Sorry, an error occurred while loading the content.

css to center image...

Expand Messages
  • ** Maria Marsala **
    I added this to my CSS file, but it s not working. Can you tell me what I could have done wrong? I m trying to make centering my image done right. I did use
    Message 1 of 6 , Jun 5, 2010
    • 0 Attachment
      I added this to my CSS file, but it's not working.



      Can you tell me what I could have done wrong?



      I'm trying to make centering my image done right. I did use the
      class="centerimage" in the document. It's still shows left justified.









      .centerimage

      {

      text-align:center;

      display:block;

      }





















      Upwards and onwards,



      Maria Marsala



      Master Business Strategist, Professional Speaker,

      Author, and former Wall Street Trader

      ___________________________________________________________________



      Insightful Solution$. Lasting Result$.



      Helping remarkable women CEOs get a life and future from their
      business

      by providing accountability, support and a (gentle) kick in the a$$
      when needed.

      Learn more at <http://www.elevatingyourbusiness.com/> Elevating Your
      Business.com






      (425) 440-9659 Office
      (917) 460-1458 NY



      (360) 271-8418 Urgent

      Elevating Your Business

      World Headquarters

      19906 Hamilton CT NE Suite A

      Poulsbo, WA 98370-8757



      Connect With Us Online:



      <http://www.linkedin.com/in/mariamarsala>
      http://www.Linkedin.com/in/mariamarsala

      <http://www.twitter.com/mariamarsala>
      http://www.Twitter.com/mariamarsala

      <http://www.facebook.com/coachmaria>
      http://www.Facebook.com/coachmaria



      This email message, including any attachments or website links, is for
      the sole use of the intended recipient(s), and may contain
      confidential and privileged information. Any unauthorized review,
      use, disclosure or distribution is prohibited. If you are not the
      intended recipient, please contact the sender by e-mail and destroy
      all copies of the original.













      [Non-text portions of this message have been removed]
    • Scottish2
      I don t know CSS but just from looking at that seems it is a text centering command not image but maybe I am wrong not sure but from what I see maybe wrong
      Message 2 of 6 , Jun 5, 2010
      • 0 Attachment
        I don't know CSS but just from looking at that seems it is a text centering command not image but maybe I am wrong not sure but from what I see maybe wrong coding???


        ----- Original Message -----
        From: ** Maria Marsala **
        To: HTML-on-the-WEB
        Sent: Saturday, June 05, 2010 9:07 PM
        Subject: [HTML-on-the-WEB] css to center image...



        I added this to my CSS file, but it's not working.

        Can you tell me what I could have done wrong?

        I'm trying to make centering my image done right. I did use the
        class="centerimage" in the document. It's still shows left justified.

        .centerimage

        {

        text-align:center;

        display:block;

        }

        Upwards and onwards,

        Maria Marsala

        Master Business Strategist, Professional Speaker,

        Author, and former Wall Street Trader

        __________________________________________________________

        Insightful Solution$. Lasting Result$.

        Helping remarkable women CEOs get a life and future from their
        business

        by providing accountability, support and a (gentle) kick in the a$$
        when needed.

        Learn more at <http://www.elevatingyourbusiness.com/> Elevating Your
        Business.com

        (425) 440-9659 Office
        (917) 460-1458 NY

        (360) 271-8418 Urgent

        Elevating Your Business

        World Headquarters

        19906 Hamilton CT NE Suite A

        Poulsbo, WA 98370-8757

        Connect With Us Online:

        <http://www.linkedin.com/in/mariamarsala>
        http://www.Linkedin.com/in/mariamarsala

        <http://www.twitter.com/mariamarsala>
        http://www.Twitter.com/mariamarsala

        <http://www.facebook.com/coachmaria>
        http://www.Facebook.com/coachmaria

        This email message, including any attachments or website links, is for
        the sole use of the intended recipient(s), and may contain
        confidential and privileged information. Any unauthorized review,
        use, disclosure or distribution is prohibited. If you are not the
        intended recipient, please contact the sender by e-mail and destroy
        all copies of the original.

        [Non-text portions of this message have been removed]





        [Non-text portions of this message have been removed]
      • Ken Robinson
        Use this: .centerimage { display: block; margin-left: auto; margin-right: auto; width: 200px; } Just use the image width instead of 200px. Ken Sent from my
        Message 3 of 6 , Jun 5, 2010
        • 0 Attachment
          Use this:

          .centerimage {
          display: block;
          margin-left: auto;
          margin-right: auto;
          width: 200px;
          }

          Just use the image width instead of 200px.

          Ken

          Sent from my Verizon Wireless BlackBerry

          -----Original Message-----
          From: "** Maria Marsala **" <groupmail@...>
          Date: Sat, 5 Jun 2010 18:07:30
          To: HTML-on-the-WEB<HTML-on-the-WEB@yahoogroups.com>
          Subject: [HTML-on-the-WEB] css to center image...

          I added this to my CSS file, but it's not working.



          Can you tell me what I could have done wrong?



          I'm trying to make centering my image done right. I did use the
          class="centerimage" in the document. It's still shows left justified.









          .centerimage

          {

          text-align:center;

          display:block;

          }





















          Upwards and onwards,



          Maria Marsala



          Master Business Strategist, Professional Speaker,

          Author, and former Wall Street Trader

          ___________________________________________________________________



          Insightful Solution$. Lasting Result$.



          Helping remarkable women CEOs get a life and future from their
          business

          by providing accountability, support and a (gentle) kick in the a$$
          when needed.

          Learn more at <http://www.elevatingyourbusiness.com/> Elevating Your
          Business.com






          (425) 440-9659 Office
          (917) 460-1458 NY



          (360) 271-8418 Urgent

          Elevating Your Business

          World Headquarters

          19906 Hamilton CT NE Suite A

          Poulsbo, WA 98370-8757



          Connect With Us Online:



          <http://www.linkedin.com/in/mariamarsala>
          http://www.Linkedin.com/in/mariamarsala

          <http://www.twitter.com/mariamarsala>
          http://www.Twitter.com/mariamarsala

          <http://www.facebook.com/coachmaria>
          http://www.Facebook.com/coachmaria



          This email message, including any attachments or website links, is for
          the sole use of the intended recipient(s), and may contain
          confidential and privileged information. Any unauthorized review,
          use, disclosure or distribution is prohibited. If you are not the
          intended recipient, please contact the sender by e-mail and destroy
          all copies of the original.













          [Non-text portions of this message have been removed]



          ------------------------------------

          ~^*~^*~^*~^*~^*~^*~^*~^*~^*~^*~^*~^*~^*~*~*~*~*~*
          For help, subscribe, unsubscribe info, archives:
          http://www.WebPage-Tools.com/htmldl.asp !!
          ~^*~^*~^*~^*~^*~^*~^*~^*~^*~^*~^*~^*~^*~*~*~*~*~*
          Yahoo! Groups Links
        • Thomas Hruska
          ... Try: margin-left: auto; margin-right: auto; Instead of text-align: center. But that is the cheating, non-holy grail way to center an image. I don t know
          Message 4 of 6 , Jun 5, 2010
          • 0 Attachment
            ** Maria Marsala ** wrote:
            > I added this to my CSS file, but it's not working.
            >
            > Can you tell me what I could have done wrong?
            >
            > I'm trying to make centering my image done right. I did use the
            > class="centerimage" in the document. It's still shows left justified.
            >
            > .centerimage
            >
            > {
            >
            > text-align:center;
            >
            > display:block;
            >
            > }

            Try:

            margin-left: auto;
            margin-right: auto;

            Instead of text-align: center.


            But that is the cheating, non-holy grail way to center an image.

            I don't know why CSS doesn't have a "horizontal-align: center;" option.
            When in doubt and don't want to wrestle with code, use the 'center'
            tag. Sure you could waste hours on the issue or simply drop in a single
            'center' tag and be done in 30 seconds. The W3C isn't always right.

            The inability to easily center things in CSS has wasted countless
            developer man-hours.

            --
            Thomas Hruska
            CubicleSoft President
            Ph: 517-803-4197

            *NEW* MyTaskFocus 1.1
            Get on task. Stay on task.

            http://www.CubicleSoft.com/MyTaskFocus/
          • Thomas Hruska
            ... http://www.w3.org/Style/Examples/007/center Seems to indicate that the width is not required. I m inclined to agree because an image has an implicit
            Message 5 of 6 , Jun 5, 2010
            • 0 Attachment
              Ken Robinson wrote:
              > Use this:
              >
              > .centerimage {
              > display: block;
              > margin-left: auto;
              > margin-right: auto;
              > width: 200px;
              > }
              >
              > Just use the image width instead of 200px.
              >
              > Ken
              >
              > Sent from my Verizon Wireless BlackBerry

              http://www.w3.org/Style/Examples/007/center

              Seems to indicate that the 'width' is not required. I'm inclined to
              agree because an image has an implicit width (whereas 'div's do not).
              You only need that if you are "centering" a div. Technically, it isn't
              centering but "space management".

              --
              Thomas Hruska
              CubicleSoft President
              Ph: 517-803-4197

              *NEW* MyTaskFocus 1.1
              Get on task. Stay on task.

              http://www.CubicleSoft.com/MyTaskFocus/
            • ** Maria Marsala **
              Ken - thanks. My concern with the code presented was the width as sometimes the graphic is in my ezine which is very narrow. Tom - thanks again. From all I
              Message 6 of 6 , Jun 7, 2010
              • 0 Attachment
                Ken - thanks. My concern with the code presented was the width as
                sometimes the graphic is in my ezine which is very narrow.

                Tom - thanks again. From all I read on the web; yes, they should do
                something with the centering of images. I was trying to see if there
                was a way to fix it other than the cheating code you presented; which
                I did read on one site is used often.

                So I'll be cheating :)


                Maria Marsala
              Your message has been successfully submitted and would be delivered to recipients shortly.