开发者

css image placement

开发者 https://www.devze.com 2023-01-13 15:42 出处:网络
I have a full width container (100%) and i like to have a image insideNOT A BACKGROUND for clicking purpose...

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 p开发者_如何转开发hoto


.container img {
display: block;
margin: 0 auto;

}


<div style="text-align: center;">
  <a href="/">
    <img src="image.png" />
  </a>
</div>


.container {
text-align: center;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消