当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- DC-1靶機
- The method of realizing high SLO on large scale kubernetes cluster
- 事务的隔离级别与所带来的问题
- Introduction to Google software testing
- 新建一个空文件占用多少磁盘空间?
- 【字节跳动 秋招岗位开放啦】Ohayoo!放学别走,我想约你做游戏!!!
- 游戏开发中的新手引导与事件管理系统
- Interpretation of Cocos creator source code: engine start and main loop
- Asp.Net Core learning notes: Introduction
- How about small and medium-sized enterprises choose shared office?
猜你喜欢
Behind the first lane level navigation in the industry
The legality of IPFs / filecoin: protecting personal privacy from disclosure
What is the purchasing supplier system? Solution of purchasing supplier management platform
检测证书过期脚本
Multi robot market share solution
每个大火的“线上狼人杀”平台,都离不开这个新功能
【自学unity2d传奇游戏开发】如何让角色动起来
Read the advantages of Wi Fi 6 over Wi Fi 5 in 3 minutes
What are PLC Analog input and digital input
Bitcoin once exceeded 14000 US dollars and is about to face the test of the US election
随机推荐
Outsourcing is really difficult. As an outsourcer, I can't help sighing.
Interpretation of Cocos creator source code: engine start and main loop
一路踩坑,被迫聊聊 C# 代码调试技巧和远程调试
大数据处理黑科技:揭秘PB级数仓GaussDB(DWS) 并行计算技术
[C] (original) step by step teach you to customize the control element - 04, ProgressBar (progress bar)
Details of dapr implementing distributed stateful service
【應用程式見解 Application Insights】Application Insights 使用 Application Maps 構建請求鏈路檢視
Who says cat can't do link tracking? Stand up for me
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
How to understand Python iterators and generators?
Look! Internet, e-commerce offline big data analysis best practice! (Internet disk link attached)
python100例項
【字节跳动 秋招岗位开放啦】Ohayoo!放学别走,我想约你做游戏!!!
How about small and medium-sized enterprises choose shared office?
一部完整的游戏,需要制作哪些音乐?
Share with Lianyun: is IPFs / filecoin worth investing in?
What is the purchasing supplier system? Solution of purchasing supplier management platform
Even liver three all night, jvm77 high frequency interview questions detailed analysis, this?
Analysis of query intention recognition
【:: 是什么语法?】