Jump to content

using CSS to have same image bg but diff sizes?


jacko_162

Recommended Posts

I have a post tag image which is a set width, how can i use this image with css to have differnt widths using the same image?

 

i have attached what the tag looks like with different sized text.

 

any help on the matter would be appreciated. this is my first FULL .css managed site and i get so confused.

 

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

I recommend you have a look in something called the sliding doors technique.

in a nutshell it uses 1 very stretched image as a sprite

and 1 nested html element. for instance:

 

<a href=""><span>link text</span></a>

 

Al you need to do now is set the same background for both the a-element and the span, but with a different background position and one the text of the span increases the image is working as if it were a sliding door.

 

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.