好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

css怎样设置button为直角

在css中,可以 利用 “border-radius”属性设置button为直角,只需要给button元素添加“{border-radius:0%;}” 或者 “{border-radius:0px;}”样式即可。

本教程操作环境:windows7系统、CSS3 && HT ML 5版、Dell G3 电 脑。

css设置button为直角的方法

在css中可以使用border-radius属性来设置元素的 圆 角边框,border-radius属性的语法为:

border-radius: 1-4 length|% / 1-4 length|%;

其中需要注意的是:

length用来定义圆角的形状,%用来以百分比定义圆角的形状。

button元素在默认情况下是有一些圆角的:

想要将button设置为直角,只需要给button元素添加“border-radius:0px;”或者“border-radius:0%;”样式即可。

示例代码如下:

<!DOCTY PE  html>
<html lang="en">
<head>
    < ;m eta charset="UTF-8">
    <meta n am e="viewport" content="width=device-width, in IT ial -s cale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie= Edge ">
    <title>Document</title>
</head>
<style>
button{
    border-radius:0%;
    }
</style>
<body>
    <button>123</button>
</body>
</html>

或者另一种形式:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
button{
    border-radius:0px;
    }
</style>
<body>
    <button>123</button>
</body>
</html>

上述两种方法输出结果是相同的:

更多编程相关知识,请访问:编程视频!!

以上就是css 怎样 设置button为直角的详细内容,更多请关注其它相关 文章 !

总结

以上是 为你收集整理的 css怎样设置button为直角 全部内容,希望文章能够帮你解决 css怎样设置button为直角 所遇到的问题。

如果觉得 网站内容还不错, 推荐好友。

查看更多关于css怎样设置button为直角的详细内容...

  阅读:42次