css圆角边框代码,css3中div圆角边框是怎么写的

html-css011

css圆角边框代码,css3中div圆角边框是怎么写的,第1张

css代码:

.yj{

padding:10pxwidth:300pxheight:50px

border: 2px solid #000000

-moz-border-radius: 15px

-webkit-border-radius: 15px

border-radius:15px

}

-moz-border-radius: 15px-webkit-border-radius: 15px 这两个是为了兼容其他一些不常用浏览写的css圆角代码

html代码:

<div class="yj">这个div四个角都圆15px</div>

结果如下:

图片圆角也是一样的:

css代码:

.yj{-moz-border-radius: 15px-webkit-border-radius: 15pxborder-radius:15px}

html代码:

<img src="xp.jpg" width="100px" height="100px" class="yj" />

结果如下:

3

css3圆角代码也支持上下左右的:

css代码这么写:

.yj{

padding:10pxwidth:300pxheight:50px

border: 2px solid #000000

-moz-border-radius: 0px 0px 20px 25px

-webkit-border-radius: 0px 0px 20px 25px

border-radius:0px 0px 20px 25px

}

一、实现CSS3无限循环动画代码示例。

代码如下:

CSS:

@-webkit-keyframes gogogo {

0%{

-webkit-transform: rotate(0deg)

border:5px solid red

}

50%{

-webkit-transform: rotate(180deg)

background:black

border:5px solid yellow

}

100%{

-webkit-transform: rotate(360deg)

background:white

border:5px solid red

}

}

.loading{

border:5px solid black

border-radius:40px

width: 28px

height: 188px

-webkit-animation:gogogo 2s infinite linear

margin:100px

}

扩展资料

实现动画无限循环所需要的CSS属性说明:

1、infinite

在animation后面加上infinite就可以无限循环,另外还可以做反向循环使用animation-direction

2、animation-name

规定需要绑定到选择器的 keyframe 名称。

3、animation-duration

规定完成动画所花费的时间,以秒或毫秒计。

4、animation-timing-function

规定动画的速度曲线。

5、animation-delay

规定在动画开始之前的延迟。

6、animation-iteration-count

规定动画应该播放的次数。

7、animation-direction

规定是否应该轮流反向播放动画。