border-radius:值越大,角越圆;
div{ width:100px; height:100px; background-color:red; border-radius:10px; border-top-left-radius:20px;}也可以根据上面4个参数,单独设置某个角。
div{ width:100px; height:100px; background-color:yellow; box-shadow: 10px 10px 5px #d8d8d8;}box-shadow: h-shadow v-shadow blur spread color inset;
h-shadow:水平向右偏移量;
v-shadow:垂直向下偏移量;
立即学习“前端免费学习笔记(深入)”;
blur:模糊距离;
spread:阴影尺寸;
color:阴影颜色;
inset:改为内阴影;
1、background-size:控制背景图片的大小;
background-size:20px 20px;
2、background-origin:3个属性可选;
3、background-clip:规定背景的绘制区域。
另外在CSS3中,background-image:可以设置多张图片了。
background-image:url(1.gif),url(2.gif);
其中transition-timing-function过渡时间,有以下几种,你可以规定它过渡的速度。
<!DOCTYPE html><html><head><style> div{ width:200px; height:200px; background-color:#d8d8d8;}div:hover{ width:300px; transition: width 2s;}</style></head><body> <div></div></body></html>鼠标移上3D转换360度。
div:hover{ transform: rotateY(360deg); transition: transform 2s;}<!DOCTYPE html><html><head><style> div{ width:100px; height:100px; background-color:#d5d5d5; color:white; animation:myfirst 5s;}@keyframes myfirst{ from {margin-left:20px;} to {margin-left:520px;transform: rotateY(360deg);}}</style></head><body><div> 飞啊飞</div></body></html>以上是改变位置,并且一边移动一边旋转的动画。
<!DOCTYPE html><html><head><style> div{ width:100px; height:100px; background-color:#d5d5d5; color:white; animation:myfirst 5s infinite;}@keyframes myfirst{ 0% {margin-left:20px;} 25% {margin-left:520px;transform: rotateY(360deg);} 50% {margin-top:120px;transform: rotateX(180deg);} 75% {margin-left:320px;transform: rotateY(360deg);} 100% {margin-top:0px;transform: rotateX(180deg);}}</style></head><body><div> 飞啊飞</div></body></html>属性自己去查吧。太多。
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号