Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 制作具有圆形边缘的3D按钮_Html_Css_Button_3d - Fatal编程技术网

Html 制作具有圆形边缘的3D按钮

Html 制作具有圆形边缘的3D按钮,html,css,button,3d,Html,Css,Button,3d,我正在开发一个网站,我想在其中实现具有圆形边缘的3D按钮。为此,我需要创建一个CSS文件。我搜索了很多关于3D按钮的信息,但迄今为止没有任何东西对我有效。请看一看试用 完成按钮的样式设置后,单击它,相应的CSS将显示在底部的框中。 <style> button { -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } </style> <butt

我正在开发一个网站,我想在其中实现具有圆形边缘的3D按钮。为此,我需要创建一个CSS文件。我搜索了很多关于3D按钮的信息,但迄今为止没有任何东西对我有效。

请看一看

试用

完成按钮的样式设置后,单击它,相应的CSS将显示在底部的框中。


<style>
button {
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
}
</style>

<button>Test</button>
钮扣{ -webkit边界半径:3px; -moz边界半径:3px; 边界半径:3px; } 试验

请参阅:

您希望使用以下css样式的组合:
边框
边框半径
背景
文本阴影
,最后是
框阴影

要使用这些工具实现3D效果,需要使用
背景
样式上的值

这里有一个制作跨浏览器渐变css的有用工具:

下面是一些示例
CSS
,它可以设置
a
标记的样式:

.button {
    display: block;
    height: 30px;
    margin-bottom: 10px;
    text-align: center;
    line-height: 30px;
    width: 150px;
    margin: 20px;

    color: #FFF;
    text-align: center;
    border: solid #427AA8 1px;
    border-radius: 5px;
    text-decoration: none;

    /* Gradient */
    background: #427AA8;
    background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iIzU5YTNlMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM0MjdhYTgiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
    background: -moz-linear-gradient(top,  #59A3E0 1%, #427AA8 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#59A3E0), color-stop(100%,#427AA8));
    background: -webkit-linear-gradient(top,  #59A3E0 1%,#427AA8 100%);
    background: -o-linear-gradient(top,  #59A3E0 1%,#427AA8 100%);
    background: -ms-linear-gradient(top,  #59A3E0 1%,#427AA8 100%);
    background: linear-gradient(to bottom,  #59A3E0 1%,#427AA8 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#59A3E0', endColorstr='#427AA8',GradientType=0 );

    text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
    box-shadow: 0 1px 0 rgba(255,255,255, 0.3), inset 0 1px 0 rgba(255,255,255, 0.3);
}

.button:hover {
    background: #59A3E0;
    text-decoration: none;
    filter: none;
}​

<a href="#" class="button">Example Button</a>

该站点和生成的按钮在Opera中无法正常工作。但是,如果通过运行生成的CSS,它应该可以工作。
<!--[if gte IE 9]>
  <style type="text/css">
    .gradient {
       filter: none;
    }
  </style>
<![endif]-->