467,915 Members | 1,455 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,915 developers. It's quick & easy.

Stretching a portion of an image

I'm trying something in CSS, and I was wondering if anyone knows of a
way to do it.

The goal is to have one image with a width of 25px, and have the left
12 pixels be one side of an image of indeterminate width, the right 12
pixels be the right side of the image, and the center pixel to stretch
the entire distance in between. I know how to do this using three
separate images, but is it possible to do it by just somehow
stretching the 1 pixel in the center?

Thanks! =)

Mar 21 '07 #1
  • viewed: 3513
Share:
2 Replies
elephant wrote:
The goal is to have one image with a width of 25px, and have the left
12 pixels be one side of an image of indeterminate width, the right 12
pixels be the right side of the image, and the center pixel to stretch
the entire distance in between.
something like this-
style-
img {position:absolute}
img.a {left:0;top:0;clip:rect(0 12px auto 0)}
img.b {left:12px;top:0;width:40%;height:26px}
img.c {right:12px;top:0;clip:rect(0 auto auto 13px)}

html-
<img src="xx" class=a>
<img src="xx" class=b>
<img src="xx" class=c>

Mar 21 '07 #2
On Mar 21, 4:05 pm, "scripts.contact" <scripts.cont...@gmail.com>
wrote:
elephant wrote:
The goal is to have one image with a width of 25px, and have the left
12 pixels be one side of an image of indeterminate width, the right 12
pixels be the right side of the image, and the center pixel to stretch
the entire distance in between.

something like this-
style-
img {position:absolute}
img.a {left:0;top:0;clip:rect(0 12px auto 0)}
img.b {left:12px;top:0;width:40%;height:26px}
img.c {right:12px;top:0;clip:rect(0 auto auto 13px)}

html-
<img src="xx" class=a>
<img src="xx" class=b>
<img src="xx" class=c>
Awesome =) Thank you very much

Mar 21 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by tzellman | last post: by
22 posts views Thread by Kim Scarborough | last post: by
15 posts views Thread by Anand Ganesh | last post: by
4 posts views Thread by Arthur Dent | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.