本文主要和大家聊聊关于css3的一些小知识,希望能帮助到大家。下面跟随小编一起来看一下吧。
box-shadow向 p 元素添加阴影
box-shadow: h-shadow v-shadow blur spread color inset;
h-shadow:必需的。水平阴影的位置。允许负值
v-shadow:必需的。垂直阴影的位置。允许负值
blur:可选。模糊距离
spread:可选。阴影的大小
color 可选。阴影的颜色。在css颜色值寻找颜色值的完整列表
inset 可选。从外层的阴影(开始时)改变阴影内侧阴影
2.transform:旋转 p 元素
兼容性问题:
-ms-transform:rotate(7deg); /* ie 9 */
-moz-transform:rotate(7deg); /* firefox */
-webkit-transform:rotate(7deg); /* safari 和 chrome */
-o-transform:rotate(7deg); /* opera */
3.transition:请把鼠标指针移动到蓝色的 p 元素上,就可以看到过渡效果。
ad846d1ec8764448f5d4e08a5ccc7b3f请把鼠标指针移动到蓝色的 p 元素上,就可以看到过渡效果。94b3e26ee717c64999d7867364b1b4a3
!doctype html>
<html>
<head>
<style>
p
{
width:100px;
height:100px;
background:blue;
transition:width 2s;
-moz-transition:width 2s; /* firefox 4 */
-webkit-transition:width 2s; /* safari and chrome */
-o-transition:width 2s; /* opera */
}
p:hover
{
width:300px;
}
</style>
</head>
<body>
<p></p>
e388a4556c0f65e1904146cc1a846beea4b561c25d9afb9ac8dc4d70affff419注释:0d36329ec37a2cc24d42c7229b69747a本例在 internet explorer 中无效。94b3e26ee717c64999d7867364b1b4a3
36cc49f0c466276486e50c850b7e4956
73a6ac4ed44ffec12cee46588e518a5e
以上就是关于css3的一些小知识的详细内容。