本文摘自PHP中文网,作者不言,侵删。
本篇文章给大家带来的内容是关于css3核心知识点的小结(代码示例),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。
css3前缀(浏览器兼容)
根据了解,css3属性大部分支持ie10,部分支持ie9,少部分支持ie8
transform(转换)
(ie9及以上支持,ie9需添加前缀-ms-)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | transform: scale(30, 60);
transform: skew(30deg, 60deg);
transform: translate(30px, 60px);
transform: rotate(30deg);
transform: rotateX(30deg);
transform: rotateY(60deg);
transform: matrix(1, 0, 0, 1, 0, 0);
|
transition(过渡)
(ie10及以上支持)
1 2 3 4 5 | transition-property: transform;
transition-duration: 2s;
transition-timing- function : linear;
transition-delay: 1s;
transition: transform 2s linear 1s;
|
@keyframes(关键帧)
(ie10及以上支持)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | @keyframes cssName1 {
from {
background: red;
}
to {
background: green;
}
}
@keyframes cssName2 {
0% {
transform: translate(0);
}
25% {
transform: translate(-200px);
}
50% {
transform: translate(0);
}
75% {
transform: translate(200px);
}
100% {
transform: translate(0);
}
}
|
animation(动画)
(ie10及以上支持)
1 2 3 4 5 6 7 8 | animation-name: name;
animation-duration: 2s;
animation-timing- function : linear;
animation-delay: 1s;
animation-iteration- count : infinite;
animation-direction: alternate;
animation-play-state: paused;
animation: name 2s linear 1s infinite alternate paused;
|
css3其他属性
css3边框
1 2 3 4 5 6 | border-radius: 10px;
box-shadow: 10px 10px 5px #999;
border-image: url(bg.jpg) 30 30 round ;
|
css3背景(ie9及以上支持)
1 2 3 | background-size: 40% 100%;
background-origin: content-box;
background-clip: content-box;
|
css3文本
1 2 3 4 | text-shadow: 3px 2px 1px #f00;
word-wrap: break -word;
|
CSS3字体(ie9及以上支持)
1 2 3 4 5 6 7 8 9 | @font-face{
font-family: myFirstFont;
font-weight: bold;
src: url( 'Sansation_Light.ttf' ),
url( 'Sansation_Light.eot' );
}
body{
font-family: myFirstFont;
}
|
css3多列(ie9及以上支持)
1 2 3 | column- count : 3;
column-gap: 40px;
column-rule: 3px outset #f00;
|
css3用户界面
1 2 3 4 5 6 7 8 9 10 11 12 13 | box-sizing: border-box;
resize: both;
outline-offset: 100px;
|
以上就是css3核心知识点的小结(代码示例)的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
css怎么让首行文字缩进
css 搜索框怎么变大
chrome css加载不出来怎么办
css中怎么将div设置为居中
css怎么选择所有子元素
为什么外接css不起作用
css怎么设置颜色渐变
css如何为元素设置背景图像
css中如何禁用a标签按钮
css中有哪些ui元素状态伪类选择器
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css3核心知识点的小结(代码示例)