开发者

Use an image for a header border bottom

开发者 https://www.devze.com 2023-03-29 11:10 出处:网络
I want to use an image for the bottom border of an image. The image used for the border bottom is 400px for example, however I don\'t want it to display a 400px bottom border for headings the are only

I want to use an image for the bottom border of an image. The image used for the border bottom is 400px for example, however I don't want it to display a 400px bottom border for headings the are only short, I want it to auto-scale.

Is there a way to display only the amount required for individual headings rather tha开发者_如何学编程n having to make up lots of image sizes for multiple heading widths.

Thank you for any help in advance...


You can use the CSS3 border-image property.

For instance

DIV {
  border: double orange 1em;
  border-image: url("border.png") 27 round stretch;
 }

You can stretch or repeat as necessary.

Read more here: http://www.w3.org/TR/css3-background/#border-images

If looks as if you could also slice the image

And more here: http://www.w3.org/TR/css3-background/#border-image-slice

0

精彩评论

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