css如何画有弧度的线

html-css012

css如何画有弧度的线,第1张

<div class="radian"></div>

.radian{

width: 200px

height: 100px

border-radius: 200px/20px/*上下有弧度的边*/

/*border-radius: 20px/200px*//*左右有弧度的边*/

background-color: red

}

border-radius是一种缩写方法。如果“/”前后的值都存在,那么“/”前面的值设置其水平半径,“/”后面值设置其垂直半径。

需要准备的材料分别有:电脑、浏览器、html编辑器。

1、首先,打开html编辑器,新建html文件,例如:index.html。

2、在index.html中的<style>标签中,输入css代码:div {height:60pxborder-bottom:1px dashed}。

3、浏览器运行index.html页面,此时通过css定义了一个水平的虚线。