Centre Images in a HTML Widget

  • Author
    Posts
  • #514493

    shane3x
    Member

    Hello,

    I’ve been previously using the Gravatar widget but the gap between the image and the links in the next widget was too long so I decided to use a HTML widget instead.

    Although I cannot get it to centre. This is my current code:

    <img src=”http://0.gravatar.com/avatar/ed72188aafed120a1367c22b1bb10a04?s=96&d=identicon&r=PG” alt=”Feedburner Icon” />

    And putting <center> </center> around the code above doesnt work as the centre code removes itself just leaving the image code behind with the standard left alignment.

    Any help provided is appreciated in advance.

    The blog I need help with is shane3x.com.

    #514591

    mark
    Staff

    Fixed that for you.
    Check the widget and adjust the -5
    If it’s not right, post back.

    #514593

    shane3x
    Member

    Oh cool it’s perfect. Thanks.

    #514597

    hallluke
    Member

    If you need to centre something else like this in the future you can use inline CSS to set automatic margins on the left and right sides:

    <img src="URL" alt="ALT" style="margin:0 auto;" />

The topic ‘Centre Images in a HTML Widget’ is closed to new replies.