PDA

View Full Version : Dear coders/CSS/vBulletin people.



Cortexian
December 9th, 2012, 11:03 PM
I have this problem, the problem is this:
http://i.imgur.com/rSFOI.jpg

Note the rep is smooched right up against the bottom of the ranks. Just like the IM Links section is smooched right up against the rep. How can I add some spacing between them, much like the spacing between the user info and the top of the ranks?

I've tried just editing the templates with line breaks and <div> sections but they're not getting me the results I want. Granted, I'm terrible with CSS. What am I looking for to add something like this? Alternatively, if you think you can do it I'll just give you admin on www.lancersedge.net (http://www.lancersedge.net) so you can fix it.

And don't get any funny ideas, the entire database and web files are backed up daily.

Donut
December 9th, 2012, 11:05 PM
looks to me like a padding thing. i know next to nothing about css too, but from what ive seen in class (taking a web dev course atm), the div the rep is in needs to have padding specified in the css.

could be entirely wrong though.

Cortexian
December 9th, 2012, 11:26 PM
I was thinking that it was a padding thing, but when I add padding to the top of the reputation part in CSS it just seems to add it above the entire section (ex: the entire section of image I posted move sdown two pixels). I tried both padding and margin stuff.

For reference, here's what's in postbit.css:


/* reputation image */
.postbit_reputation {
clear: both;
display: block;
font-size: 0;
padding-left: 2px;
}

img.repimg {
display: inline;
margin-left: -2px;
}

And what my postbit_legacy template looks like around that area:


<div class="userinfo">
<div class="username_container">
<vb:if condition="$post['userid']">
{vb:raw memberaction_dropdown}
{vb:raw post.onlinestatus}
<vb:else />
<span class="username guest">{vb:raw post.musername}</span>
</vb:if>
</div>
<span class="usertitle">
{vb:raw post.usertitle}
</span>
{vb:raw template_hook.postbit_userinfo_left}
<vb:if condition="$show['reputation']">
<span class="postbit_reputation" id="repdisplay_{vb:raw post.postid}_{vb:raw post.userid}">{vb:raw post.reputationdisplay}</span>
</vb:if>
<vb:if condition="$show['avatar']">
<a class="postuseravatar" href="{vb:link member, {vb:raw post}}" title="{vb:rawphrase {vb:raw post['onlinestatusphrase']}, {vb:raw post.username}}">
<img src="{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" title="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</a>
</vb:if>
<vb:if condition="$post['userid']">
<hr />
<dl class="userinfo_extra">
<vb:if condition="$post['joindate']"><div class="vbipostbit"><dt>{vb:rawphrase join_date}</dt> <dd>{vb:raw post.joindate}</dd></div></vb:if>
<vb:if condition="$post['field2']"><div class="vbipostbit"><dt>{vb:rawphrase location_perm}</dt> <dd>{vb:raw post.field2}</dd></div></vb:if>
<vb:if condition="$post['age']"><div class="vbipostbit"><dt>{vb:rawphrase age}</dt> <dd>{vb:raw post.age}</dd></div></vb:if>
<div class="vbipostbit"><dt>{vb:rawphrase 'posts'}</dt> <dd>{vb:raw post.posts}</dd></div>
{vb:raw template_hook.postbit_userinfo_right_after_posts}
</dl>
<vb:if condition="$show['infraction'] OR $show['reppower']">
<dl class="user_rep">
<vb:if condition="$show['infraction']">
<dt>{vb:rawphrase infractions}</dt>
<dd>{vb:raw post.warnings}/{vb:raw post.infractions} ({vb:raw post.ipoints})</dd>
</vb:if>
<vb:if condition="$show['reputation']">
<vb:if condition="$show['reppower']">
<div class="vbipostbit"><dt>{vb:rawphrase reppower}</dt>
<dd id="reppower_{vb:raw post.postid}_{vb:raw post.userid}">{vb:raw post.reppower}</dd></div>
</vb:if>
</vb:if>
</dl>
</vb:if>
{vb:raw template_hook.postbit_userinfo_right}
<vb:if condition="$post['rank']">
<span class="rank">{vb:raw post.rank}</span>
</vb:if>
<vb:if condition="$show['reputation']">
<span class="postbit_reputation" id="repdisplay_{vb:raw post.postid}_{vb:raw post.userid}" title="{vb:raw post.username} {vb:raw post.level}">
<vb:each from="reputationdisplay" value="row">
<img class="{vb:raw row.class}" src="{vb:stylevar imgdir_reputation}/reputation_{vb:raw row.posneg}{vb:raw row.imgext}" alt="" />{vb:raw row.rowend}
</vb:each>
</span>
</vb:if>
<div class="imlinks">
{vb:raw post.icqicon} {vb:raw post.aimicon} {vb:raw post.msnicon} {vb:raw post.yahooicon} {vb:raw post.skypeicon}
</div>
</vb:if>
</div>


The bits I think are relevant are bolded, the red things mentioning reputation... I honestly don't know enough about vBulletin to know what those sections of code are trying to accomplish, but the rep bars wouldn't show up in the postbit until I manually added the green section from the default style postbit.

Btcc22
December 10th, 2012, 12:13 AM
.postbit_reputation {
clear: both;
display: block;
font-size: 0;
padding-left: 2px;
margin: 5px; /* adjust as desired */
}


Delete the red sections from the template as they seem to be errant and will just interfere with the styling.

Cortexian
December 10th, 2012, 12:36 AM
Success! I believe I tried margin-top: 2px; before but it didn't seem to have any effect D: