开发者

css repeat-x rightside

开发者 https://www.devze.com 2023-03-02 02:42 出处:网络
is it possible to repeat only right side of picture. If I have a menu button picture, there are border or stripe on left side and I only want to repeat rig开发者_开发百科ht side(without border).

is it possible to repeat only right side of picture. If I have a menu button picture, there are border or stripe on left side and I only want to repeat rig开发者_开发百科ht side(without border).

When I'm just putting repeat-x scroll right or just repeat-x, the whole picture will repeat, but I only want right side to repeat, not left or whole picture.

I hope you understand what I mean.

css repeat-x rightside

This is button example. When my button title is too long and it will need to repeat button picture. Can I only repeat that yellow part of picture? not together with red. PS! Cant repeat color, because button is made with cradient.


Short answer, no, it's not possible.

A picture has fixed-width and you can't stretch just a part of it.

Solution: use two pictures, one for the left side, with fixed size and other to the right side which you can use repeat-x to fill the remaining space.

EDIT:

If your button have a horizontal gradient, the best you can do is to make a picture wide enough to encompass "almost" all cases. The key word here is almost because you can always find someone with a screen wider than the image itself.


Not sure why you can't use a solid color, but why not simply use a wider image?

css repeat-x rightside


just put "no-repeat top right" is that what your meaning


Smashing Magazine has an excellent tutorial on designing buttons with CSS:

http://www.smashingmagazine.com/2009/11/18/designing-css-buttons-techniques-and-resources/

Scroll down to the section "Sliding Doors: Flexible Buttons", it explains exactly what you're looking for.

0

精彩评论

暂无评论...
验证码 换一张
取 消