Changing Avatar Size In Comments With CSS

  • Author
    Posts
  • #177735

    sundrop74
    Member

    Is it possible to change the size of the avatar in the comments section using CSS? I’m using the Sandbox-10 theme. Thanks.

    #177918

    I just checked with Firebug on a few different themes and the size is not defined in the CSS, but in the php/html. I expect that is the same with all themes.

    #177919

    vivianpaige
    Member

    I’m not sure about Sandbox but in my theme, the avatar size was fixed (at too small a size) and when I tried to make it larger, all it did was stretch the picture. Here’s the code I used:

    .comment list li .avatar {
    	float:right;
    	height:32px;
    	width:32px;
    	padding:2px;
    }

    #177920

    vivianpaige
    Member

    I see tsp beat me to it. But if you want to make them smaller, the code should work.

    #177922

    @vivian
    That will work in the comments widget, but not on the comments section below the posts, which is what I though the OP was asking. Perhaps they can clarify that.

    #177923

    And in the recent comments widget, you can set the size of the avatars down to 16×16 by editing the widget’s settings.

    #177925

    vivianpaige
    Member

    tsp – sorry, but you’re wrong on this one. That code is in use on my blog right now. When I put it in originally, it enlarged the 16×16 avatar to 32×32, but as I mentioned above, it stretched the image since the avatar was hard coded in the php/html. I convinced the fine people here at WP to increase the size of the avatars in the comments section to 32×32, so I just left that code there (since it also floated my avatars to the right, instead of being on the left).

    If the OP wants a smaller avatar, that code would work (simply change the height and width).

    I actually copied that code, BTW, from another WP.com blog CSS that I saw somewhere.

    #177926

    vivianpaige
    Member

    BTW – I just tested it at 16×16 and it correctly resized the avatar.

    #177927

    Hmmm, Ok. I’ll have to remember that.

The topic ‘Changing Avatar Size In Comments With CSS’ is closed to new replies.