html - 为什么我的自定义按钮样式不起作用?

标签 html css button

我想更改我的按钮,使它们看起来不像默认的灰色按钮。

.button {
border-top: 1px solid #2b2b2b;
background: #2b2b2b;
background: -webkit-gradient(linear, left top, left bottom, from(#262626), to(#2b2b2b));
background: -webkit-linear-gradient(top, #262626, #2b2b2b);
background: -moz-linear-gradient(top, #262626, #2b2b2b);
background: -ms-linear-gradient(top, #262626, #2b2b2b);
background: -o-linear-gradient(top, #262626, #2b2b2b);
padding: 7px 14px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
box-shadow: rgba(0,0,0,1) 0 1px 0;
text-shadow: rgba(0,0,0,.4) 0 1px 0;
color: white;
font-size: 16px;
font-family: 'Lucida Grande', Helvetica, Arial, Sans-Serif;
text-decoration: none;
vertical-align: middle;
}
.button:hover {
border-top-color: #303030;
background: #303030;
color: #ffffff;
}
.button:active {
border-top-color: #2b2b2b;
background: #2b2b2b;
}
<button type="button" onClick="window.location.href='https://itunes.apple.com/gb/podcast/canon-slade-digital-leaders/id588207792'">Find our Podcasts on iTunes ⇒</button>

但出于某种原因,按钮看起来没有任何不同。

我哪里出错了?

最佳答案

不要使用:

.button {}

不带点使用:

button {}

关于html - 为什么我的自定义按钮样式不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19894906/

相关文章:

html - 限制 CSS 表格的高度 - 忽略内容高度

javascript - 如何更改 div 的不透明度?

sql - 点击按钮执行sql查询

css - 样式 Bootstrap 表按钮 - btn-primary dropdown-toggle

html - 使用静态 header 创建动态大小的 DIV 框

css - 无法将按钮添加到自定义滚动条

html - 如何显示CSS文件中所有没有定义的类?

javascript - 在 Javascript 函数中添加多个样式不起作用

html - 在 bootstrap3.0 中修复鼠标悬停打开的菜单后,当我们点击 menuitem 时菜单没有关闭它保持打开状态

javascript - 单击动态生成的单选按钮