Jump to content

background-image wits end


e1seix

Recommended Posts

Hi all, having a bit of problem with the following:

 

echo '<div id="bottomImage">
  <a href="/viewItem.php?sku='.$row[sku].'">
    <img alt="'.$row[name].'" height="98px" src="/images/'.$row[image].'.jpg" width="98px" />
  </a>
</div>';
echo '<div id="bottomName">
  <a href="/viewItem.php?sku='.$row[sku].'">'.$row[brand].' - '.$row[name].'</a>
</div>';

 

I want to go about setting background-image of "bottomImage" to the image tag source, however the root of the image is 250px by 250px whereas to fit within the confines of bottomImage it would need to be a maximum of 100px by 100px.

 

Also on the side, I would set some sort of transparent gif where the image tag is now.

 

I cannot figure out how I'd go about doing this, especially limiting the background-image url to just 100px by 100px.

 

Any help?

 

Many thanks

Link to comment
Share on other sites

Firstly, if you have a 250px x 250px image and you need it to be smaller, just resize it.  That's the best solution to that problem.  And then you don't have to worry about the quality of the image when its resized in the browser.

 

And what do you mean some sort of transparent gif on the side? Like another tiling background-image?  Why do you need a transparent gif (which I'm assuming means a small image that's completely clear)?  If you want a space before something starts, use a margin.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.