Skip navigation
Currently Being Moderated

Centering an image

Jun 8, 2012 7:09 PM

Tags: #help #image #mac #dreamweaver #images #code #html5 #dw

For the life of me I cannot make this work. I'm trying to update one of my pages and cleanup the code. All I want to do is center the two images and one line of text under the banner div. It's working on the uploaded page, but not the local version I'm revising.


Here's the older page:


and the css stylesheet:

  • Currently Being Moderated
    Jun 8, 2012 8:25 PM   in reply to kcfi

    Create a separate class to center images:

    .center_img {

          display: block;

          margin-left: auto;

          margin-right: auto;


    and then another to center text:

    .center_this {

          text-align: center;


    Best wishes,


    Mark as:
  • Currently Being Moderated
    Jun 9, 2012 5:30 AM   in reply to kcfi

    Why not just do it this way?


    #container img {


         margin:0 auto;


    #container p {







    <div id="container">


      <img src="../assets/email/emailaddress.gif" alt="" width="500" height="156" class="center_img">

      <img src="../assets/logo.png" alt="" width="670" height="454" class="center_img">

      <p>(800) 408-5245</p>


    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points