0

i'm noticing when i attempt to center this image, it is slightly to the right on the page. what is causing that? it seems like there is a margin added to the left of the image.

<head>
         <meta charset="utf-8">
         <title>test</title>
         <link rel="stylesheet" href="http://flip.hr/css/bootstrap.min.css">  </head>

 <body>

<div class="container">
        <img src="dovelow.jpg" alt="Dove">

</div>
       </body>

1 Answer 1

2

the margin-left: auto; on the containter causing that.

You should do something like this:

.container {
    width: inherit;
    text-align: center;
    background-color: pink;
}

img {
    width: 100px;
    height: 100px;
}

See http://jsfiddle.net/yuhJQ/1/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.