当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- What are manufacturing and new automation technologies?
- 嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:曾文旌
- An article will take you to understand CSS3 fillet knowledge
- Pollard's Rho algorithm
- Kubernetes and OAM to build a unified, standardized application management platform knowledge! (Internet disk link attached)
- MongoDB与SQL常用语法对应表
- What is alicloud's experience of sweeping goods for 100 yuan?
- 事务的本质和死锁的原理
- 意派Epub360丨你想要的H5模板都在这里,电子书、大转盘、红包雨、问卷调查……
- 【自学unity2d传奇游戏开发】地图编辑器
猜你喜欢

From overseas to China, rancher wants to do research on container cloud market

【转发】查看lua中userdata的方法

事件监听问题

It is really necessary to build a distributed ID generation service

小游戏云开发入门

What knowledge do Python automated testing learn?

Kubernetes and OAM to build a unified, standardized application management platform knowledge! (Internet disk link attached)

What are manufacturing and new automation technologies?

Bitcoin once exceeded 14000 US dollars and is about to face the test of the US election

DRF JWT authentication module and self customization
随机推荐
Details of dapr implementing distributed stateful service
代码生成器插件与Creator预制体文件解析
事件监听问题
CloudQuery V1.2.0 版本发布
Live broadcast preview | micro service architecture Learning Series live broadcast phase 3
理解格式化原理
Filecoin has completed a major upgrade and achieved four major project progress!
Tron smart wallet PHP development kit [zero TRX collection]
ES6 learning notes (5): easy to understand ES6's built-in extension objects
消息队列(MessageQueue)-分析
Take you to learn the new methods in Es5
【学习】接口测试用例编写和测试关注点
Introduction to Google software testing
How to understand Python iterators and generators?
An article will take you to understand SVG gradient knowledge
How about small and medium-sized enterprises choose shared office?
The method of realizing high SLO on large scale kubernetes cluster
代码重构之法——方法重构分析
hdu3974 Assign the task線段樹 dfs序
行为型模式之备忘录模式