Jump to content
MakeWebGames

display pic error - help:::


Hybridd

Recommended Posts

106k321.png

trying to put the display image in the middle but image not showing...

code is this:

<div id='avatar'></div>

 

iv tried this:

<div id='avatar'>
if($ir['display_pic'])
{
print"<img src='{$ir['display_pic']}' width='63' height='68' border='0'></a>";
}else{
print "<img src='images/display.png' width='63' height='68' border='0'></a>";
}
</div> 

doesn't work tho

Link to comment
Share on other sites

:( nope not worked.

code i used:

<div id='avatar'>
<center>
<img src="{$ir['display_pic']}" class='img' width='63' height='68' border='0'></a>
</center>
</div>

 

css i used:

<script>
img {
   position: absolute;
   background-image: url("{$ir['display_pic']}");
   width: 60px;
   hight: 60px;
   left: 0px;
   top: 0px;
   z-index: -1;
} 
</script>

 

what am i doing wrong?

its not showing the image instead it shows a little icon which means image not found or something like that

Link to comment
Share on other sites

Looks like there are some things wrong with this picture...

 

  1. <script>

    is the incorrect tag for css. You should use

    <style>

    instead to indicate css. So, your css should look like this now:

    <style>
    img {
       position: absolute;
       background-image: url("{$ir['display_pic']}");
       width: 60px;
       hight: 60px;
       left: 0px;
       top: 0px;
       z-index: -1;
    }
    </style>


  2. Not sure why you're including PHP code in the css. This really should not be necessary. Also, not sure what was originally in the "background-image" property (if any), but this should not be changed. So, with this in mind, your css should now look like this:
    <style>
    img {
       position: absolute;
       background-image: (what was originally here. if none, delete this property)
       width: 60px;
       hight: 60px;
       left: 0px;
       top: 0px;
       z-index: -1;
    }
    </style>


  3. Verify that the path to the avatar images is correct (if uploaded). If the value of
    $ir['display_pic']}

    is only the file name for an uploaded image, this will not work with how it is currently coded.

  4. Do realize that by adding css to the
    <img>

    tag (which you are doing with that css) that this will change the properties for ALL images that are coded in such a fashion regardless of what they are. If you have taken this into account, then that's good!

 

Feel free to respond to this post or PM me if you have any questions. :)

~G7470

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...