Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the border-image attribute in css

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to use the border-image attribute in css", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use the border-image attribute in css" this article.

CSS3border-image attribute

Purpose: use pictures to create borders

Description: compound attributes. Sets or retrieves the border style of the object to be filled with an image. You can set the values of the border-image-source,border-image-slice,border-image-width,border-image-outset and border-image-repeat properties at once.

Syntax:

Border-image:sourceslicewidthoutsetrepeat | initial | inherit

Parameters:

Border-image-source: lets you specify the location of the image you want to use to draw the border.

Border-image-slice: the image boundary is offset inward.

Border-image-width: the width of the image boundary.

Border-image-outset: lets you specify how much border-image-area is drawn outside the border.

Border-image-repeat: sets whether the image boundary should repeat (repeat), stretch (stretch), or round (round).

Example of using css3border-image property

Div

{

Border:15pxsolidtransparent

Width:300px

Padding:10px20px

}

# round

{

-moz-border-image:url (https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030round;/*OldFirefox*/

-webkit-border-image:url (https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030round;/*SafariandChrome*/

-o-border-image:url (https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030round;/*Opera*/

Border-image:url (https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030round;

}

# stretch

{

-moz-border-image:url (https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030stretch;/*OldFirefox*/

-webkit-border-image:url (https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030stretch;/*SafariandChrome*/

-o-border-image:url (https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030stretch;/*Opera*/

Border-image:url (https://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg)3030stretch;

}

Here, the picture is covered with the entire frame.

Here, the picture is stretched to fill the area.

This is the picture we used:

Note: the border-image attribute is not supported by InternetExplorer.

The border-image property specifies the picture to use as a border.

The above is all the content of the article "how to use the border-image attribute in css". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report