Grow your CSS skills. Land your dream job.

centering image in
tag

  • # May 30, 2013 at 2:29 am

    Here is my example
    http://codepen.io/seraphzz/pen/etfvp

    Why do you think the image is not centering within the figure tag.
    I tried to use margin: auto auto; to fix it, but it isn’t working.
    I need help lol. I appreciate your time looking and helping me learn better css :)

    # May 30, 2013 at 2:34 am

    hello,

    img tag is inline boxe, you center it as it would be text.

    http://codepen.io/seraphzz/pen/FmBdw

    # May 30, 2013 at 3:33 am

    img { margin:0 auto } should work just fine. Of course you need to make img a block element with img { display:block } otherwise it won’t work.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".