当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Humor: hacker programming is actually similar to machine learning!
- 快速排序为什么这么快?
- How to turn data into assets? Attracting data scientists
- 【学习】接口测试用例编写和测试关注点
- What are the criteria for selecting a cluster server?
- 只有1个字节的文件实际占用多少磁盘空间
- 意派Epub360丨你想要的H5模板都在这里,电子书、大转盘、红包雨、问卷调查……
- Discussion on the development practice of aspnetcore, a cross platform framework
- Ronglian completed US $125 million f round financing
- 常用SQL语句总结
猜你喜欢
PHP application docking justswap special development kit【 JustSwap.PHP ]
大道至简 html + js 实现最朴实的小游戏俄罗斯方块
事务的本质和死锁的原理
【自学unity2d传奇游戏开发】如何让角色动起来
01. SSH Remote terminal and websocket of go language
Will blockchain be the antidote to the global epidemic accelerating the transformation of Internet enterprises?
代码生成器插件与Creator预制体文件解析
意外的元素..所需元素..
The AI method put forward by China has more and more influence. Tianda et al. Mined the development law of AI from a large number of literatures
Unity性能优化整理
随机推荐
Digital city responds to relevant national policies and vigorously develops the construction of digital twin platform
What are the common problems of DTU connection
Outsourcing is really difficult. As an outsourcer, I can't help sighing.
DC-1靶機
It is really necessary to build a distributed ID generation service
Top 5 Chinese cloud manufacturers in 2018: Alibaba cloud, Tencent cloud, AWS, telecom, Unicom
【應用程式見解 Application Insights】Application Insights 使用 Application Maps 構建請求鏈路檢視
Isn't data product just a report? absolutely wrong! There are university questions in this category
Pollard's Rho algorithm
【自学unity2d传奇游戏开发】如何让角色动起来
使用 Iceberg on Kubernetes 打造新一代雲原生資料湖
代码生成器插件与Creator预制体文件解析
大会倒计时|2020 PostgreSQL亚洲大会-中文分论坛议程安排
Network security engineer Demo: the original * * is to get your computer administrator rights! [maintain]
前端未來趨勢之原生API:Web Components
Installing ns-3 on ubuntu18.04
Azure data factory (3) integrate azure Devops to realize CI / CD
Gather in Beijing! The countdown to openi 2020
Try to build my mall from scratch (2): use JWT to protect our information security and perfect swagger configuration
只有1个字节的文件实际占用多少磁盘空间