PDA

View Full Version : How I can center avatar


SilverBoy
05-03-2016, 05:47 PM
Hi

I want to put the avatar of the user in the center of the block in postbit legacy template, I tried every thing I can think of but without luck, could you please help me in doing this thing?

MarkFL
05-03-2016, 06:51 PM
Try adding the following CSS selector to your "additional.css" template:

.postuseravatar {
text-align: center !important;
width: 100% !important;
}

SilverBoy
05-03-2016, 07:31 PM
Thank you it works great :)

TheLastSuperman
05-05-2016, 01:42 AM
Note: Overkill if only wanting avatar centered however... You could center all of it, some prefer all of the userinfo centered (within reason) here is a snippet of code that will do so (most of which I copied from a post by Lynne loooooong ago other additions over time).

/* center avatar, username, title, rank, userinfo_extra, postbit_reputation, imlinks */
.postbitlegacy .userinfo .username_container, .postbitlegacy .userinfo .rank, .postbitlegacy .userinfo .usertitle .imlinks {
text-align:center;
}
.postbitlegacy .userinfo .postuseravatar, .postbitlegacy .userinfo .postuseravatar img {
float:none;
text-align:center;
}
.postbitlegacy .userinfo .usertitle {
display: block;
float:none;
text-align:center;
clear: both;
}
.postbitlegacy .userinfo .userinfo_extra {
text-align:center;
clear: both;
}
.postbit_reputation {
float:none;
text-align:center;
}
.postbitlegacy .imlinks {
float:none;
text-align:center;
}
.postbitlegacy .after_content {
clear:right !important;
}

I can't recall if the items listed like location would look wonky, if so you could try also adding:
.postbitlegacy .userinfo .userinfo_extra dl {
text-align:center;
}

.postbitlegacy .userinfo .userinfo_extra dt {
float:left;
text-align:right;
}

.postbitlegacy .userinfo .userinfo_extra dd {
float:left;
text-align:center;
}

^ I had the bottom code commented out using /* .cssdefinition {code etc} */ so can't recall why in my one test style I did that, might not need to add the bottom code but there for reference.