Tuesday, April 5, 2011

css image placement

I have a full width container (100%) and i like to have a image inside NOT A BACKGROUND for clicking purpose...

How can i center the image into the container horizontally ?

here is a sample : http://notrepanorama.com/test/


Solution :

.centerimage {
    margin-left: -960px;
    width: 1920px;
    left: 50%;
    position: absolute;
}

Since i have found the solution to my problem, i will give the checked (√) to the one the will tell me why the spacing before the blue box, it's should be adjacent to the photo

From stackoverflow
  • <div style="text-align: center;">
      <a href="/">
        <img src="image.png" />
      </a>
    </div>
    
  • .container {
    text-align: center;
    }
    
  • .container img {
    display: block;
    margin: 0 auto;
    

    }

0 comments:

Post a Comment