当前位置:网站首页>An article takes you to understand CSS3 picture border
An article takes you to understand CSS3 picture border
2020-11-06 20:48:00 【Python advanced】
CSS3 Picture frame
Use CSS3 border-image attribute , You can set picture borders around the elements .
One 、 Browser support
The number in the table specifies the first browser version that fully supports this property .
After the number -webkit- perhaps -moz- You need to specify the prefix when you use it .

Two 、CSS3 border-image attribute
CSS3 border-image Property allows you to specify the image to be used instead of the normal boundary around the element . Attributes have three parts :
-
Pictures as borders .
-
Where to segment the image .
-
Make sure the middle part should be repeated or extended .
Take the image below ( be called "border.png") For example :

Principle analysis :
border-image Sex divides the image into nine parts , It's like a tic tac toe board . Then put the corner on the corner , The middle part repeats or stretches in a specified order .
Be careful :
Give Way border-image Normal work , Elements also need to set border properties !
1. The middle of the image is repeated to create boundaries , Pictures as borders
CSS Code :
<!DOCTYPE CSS>
<CSS lang="en">
<head>
<meta charset="UTF-8">
<title> project </title>
</head>
<body>
<p id="borderimg"> ad locum , The middle part of the image is extended to create a boundary .</p>
<p> Here's the original image :</p><img src="img/border.png">
</body>
</CSS>
The code is as follows :
#borderimg {
border: 10px solid transparent;
padding: 15px;
-webkit-border-image: url(img/border.png) 30 round; /* Safari 3.1-5 */
-o-border-image: url(img/border.png) 30 round; /* Opera 11-12.1 */
border-image: url(img/border.png) 30 round;
}

2. The middle of the image extends to the creation boundary : Use pictures as borders !
The sample code :
#borderimg {
border: 10px solid transparent;
padding: 15px;
-webkit-border-image: url(img/border.png) 30 stretch;
/* Safari 3.1-5 */
-o-border-image: url(img/border.png) 30 stretch;
/* Opera 11-12.1 */
border-image: url(img/border.png) 30 stretch;
}

Be careful : border-image The attribute is border-image-source, border-image-slice, border-image-width, border-image-outset and border-image-repeat Abbreviation .
1. Different slice values
Different slice values completely change the appearance of the border :
example 1
border-image: url(border.png) 50 round;
#borderimg1 {
border: 10px solid transparent;
padding: 15px;
-webkit-border-image: url(img/border.png) 50 round;
/* Safari 3.1-5 */
-o-border-image: url(img/border.png) 50 round;
/* Opera 11-12.1 */
border-image: url(img/border.png) 50 round;
}

example 2
border-image: url(border.png) 20% round;
#borderimg2 {
border: 10px solid transparent;
padding: 15px;
-webkit-border-image: url(img/border.png) 20% round;
/* Safari 3.1-5 */
-o-border-image: url(img/border.png) 20% round;
/* Opera 11-12.1 */
border-image: url(img/border.png) 20% round;
}

example 3
border-image: url(border.png) 30% round;
The code is as follows :
#borderimg3 {
border: 10px solid transparent;
padding: 15px;
-webkit-border-image: url(img/border.png) 30% round;
/* Safari 3.1-5 */
-o-border-image: url(img/border.png) 30% round;
/* Opera 11-12.1 */
border-image: url(img/border.png) 30% round;
}

3、 ... and 、 summary
This article is based on CSS Basics , Use CSS Language , This paper introduces about CSS Knowledge points to define picture borders , Start with the basic concept of attributes ,border-image Usage of , In practical application, we should pay attention to the problems , Made a detailed explanation . Through the demonstration of examples . Hope to help you learn better CSS.
Want to learn more Python Web crawler and data mining knowledge , Go to a professional website :http://pdcfighting.com/ Want to learn more Python Web crawler and data mining knowledge , Go to a professional website :http://pdcfighting.com/
版权声明
本文为[Python advanced]所创,转载请带上原文链接,感谢
边栏推荐
- Gather in Beijing! The countdown to openi 2020
- It is really necessary to build a distributed ID generation service
- Application of restful API based on MVC
- 华为云微认证考试简介
- FastThreadLocal 是什么鬼?吊打 ThreadLocal 的存在!!
- StickEngine-架构12-通信协议
- IPFs rudder filecoin landing at the same time, fil currency price broke a thousand
- 【應用程式見解 Application Insights】Application Insights 使用 Application Maps 構建請求鏈路檢視
- PHP application docking justswap special development kit【 JustSwap.PHP ]
- hdu3974 Assign the task線段樹 dfs序
猜你喜欢

What knowledge do Python automated testing learn?

FastThreadLocal 是什么鬼?吊打 ThreadLocal 的存在!!

Will blockchain be the antidote to the global epidemic accelerating the transformation of Internet enterprises?

An article will take you to understand SVG gradient knowledge

Shh! Is this really good for asynchronous events?

【学习】接口测试用例编写和测试关注点

【自学unity2d传奇游戏开发】如何让角色动起来

What are PLC Analog input and digital input

Multi robot market share solution

解决 WPF 绑定集合后数据变动界面却不更新的问题
随机推荐
Small program introduction to proficient (2): understand the four important files of small program development
Use modelarts quickly, zero base white can also play AI!
嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:王涛
Application of restful API based on MVC
StickEngine-架构11-消息队列(MessageQueue)
事件监听问题
小游戏云开发入门
Filecoin has completed a major upgrade and achieved four major project progress!
What are the common problems of DTU connection
Bitcoin once exceeded 14000 US dollars and is about to face the test of the US election
A small goal in 2019 to become a blog expert of CSDN
理解格式化原理
Network programming NiO: Bio and NiO
Shh! Is this really good for asynchronous events?
Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
C#和C/C++混合编程系列5-内存管理之GC协同
From overseas to China, rancher wants to do research on container cloud market
Git rebase is in trouble. What to do? Waiting line
美团内部讲座|周烜:华东师范大学的数据库系统研究
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom