News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

avatar background

Started by Cottelletje, March 22, 2006, 10:01:04 AM

Previous topic - Next topic

Cottelletje

how do you put around a avatar(always 100x100x pixels) a white background but the avatar has to be in the center otherwise its all screwed up
i found a code from somebody but it doesn't work good this is the result :

// Show avatars, images, etc.
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
echo '
<div style="overflow: auto; width: 100%; background-color: #FFFFFF; padding: 3px; border: 1px solid #F6F6F6;">', $message['member']['avatar']['image'], '</div><br />';

and this is the result but it should be on both sides even



whats the problem?
|| Leonardo Dicaprio is the Hottest Man Alive Believe Me ||

Thantos

<div style="overflow: auto; width: 100%; background-color: #FFFFFF; padding: 3px; border: 1px solid #F6F6F6; text-align: center;">', $message['member']['avatar']['image'], '</div><br />';

Will do it I believe.

Cottelletje

no it doesn't work if i use that this is the result



and this is what i want

|| Leonardo Dicaprio is the Hottest Man Alive Believe Me ||

Thantos

then take off the width part of the style.

Cottelletje

if i do that it is whole screwed up ...
if i change width to 100px its ok in IE but in Firefox the bottom is much larger around the avatar  ???
|| Leonardo Dicaprio is the Hottest Man Alive Believe Me ||

Acf

How about browser detect then?
style="' , !$context['browser']['is_ie'] ? 'valeu true' : 'valeu false', '"
Sigh...

Cottelletje

don't now what you mean by that acf

it looks now in ie like this


but in firefox it looks like this


so what is the **** problem :-X
|| Leonardo Dicaprio is the Hottest Man Alive Believe Me ||

Acf

For example you can set style padding x in ff and padding y in ie

style="' , !$context['browser']['is_ie'] ? 'FF' : 'IE', '"
Sigh...

Cottelletje

where in that line do i set the padding,can't see a ...px?
|| Leonardo Dicaprio is the Hottest Man Alive Believe Me ||

Acf

cause i did not make the example that way.
this will remove 3 px of padding at the bottom.
style="overflow: auto; width: 100%; background-color: #FFFFFF; ' , !$context['browser']['is_ie'] ? 'padding-left: 3px; padding-right: 3px; padding-top: 3px; padding-bottom: 0px; : 'padding: 3px;', '  border: 1px solid #F6F6F6;"

Sigh...

Cottelletje

thats very complicated man for such a small thing? ;D
|| Leonardo Dicaprio is the Hottest Man Alive Believe Me ||

Acf

#11
its just a ifelse statement ;)
Sigh...

Cottelletje

so just need to put that code in the file? ::)
|| Leonardo Dicaprio is the Hottest Man Alive Believe Me ||

Acf

You could try to do that :)

But i am not sure if its effective enough to solve your problem. I could take closer look at it if you could post your display.template.php and style.css, so i can put it on my localserver(rc2) and look closer at it.
Sigh...

Cottelletje

|| Leonardo Dicaprio is the Hottest Man Alive Believe Me ||

Advertisement: