Html 按钮样式无效

Html 按钮样式无效,html,css,button,htmlbutton,Html,Css,Button,Htmlbutton,我想改变我的按钮,这样它们就不会看起来像默认的灰色按钮。 我已将此添加到CSS中,以尝试使它们看起来与众不同: .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, #2

我想改变我的按钮,这样它们就不会看起来像默认的灰色按钮。 我已将此添加到CSS中,以尝试使它们看起来与众不同:

.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;
}
这是我在页面上制作按钮的html:

<button type="button" onClick="window.location.href='https://itunes.apple.com/gb/podcast/canon-slade-digital-leaders/id588207792'">Find our Podcasts on iTunes ⇒</button>
在iTunes上查找我们的播客⇒
但由于某些原因,按钮看起来没有什么不同

我哪里出错了/

不要使用:

.button {}
不带圆点使用:

button {}
不要使用:

.button {}
不带圆点使用:

button {}

您正在设置类的样式
。按钮
。。。改用
按钮

更新的CSS:

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;
}

您正在设置类的样式
。按钮
。。。改用
按钮

更新的CSS:

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;
}

这是我键入的代码

.container0{
位置:中心;
宽度:100%;
最大宽度:400px;
}  
.container0.btn0{
位置:绝对位置;
最高:85%;
左:49.5%;
转换:翻译(-50%,-50%);
-ms转换:翻译(-50%,-50%);
背景色:红色;
颜色:白色;
字体大小:16px;
填充:12px 24px;
边界:无;
光标:指针;
边界半径:5px;
文本对齐:居中;
}
.container0.btn0:悬停{
背景颜色:绿色;
}

添加到购物车

这是我键入的代码

.container0{
位置:中心;
宽度:100%;
最大宽度:400px;
}  
.container0.btn0{
位置:绝对位置;
最高:85%;
左:49.5%;
转换:翻译(-50%,-50%);
-ms转换:翻译(-50%,-50%);
背景色:红色;
颜色:白色;
字体大小:16px;
填充:12px 24px;
边界:无;
光标:指针;
边界半径:5px;
文本对齐:居中;
}
.container0.btn0:悬停{
背景颜色:绿色;
}

添加到购物车

删除按钮前的点或将类“按钮”添加到按钮上,则该按钮应能正常工作。删除按钮前的点或将类“按钮”添加到按钮上,则该按钮应能正常工作。谢谢,我已删除点,按钮仍然不走运。什么都没变(正如你在链接的演示中所看到的那样,“什么都没有改变”,这种方法是有效的。那么,你在你的页面中更改了CSS吗?清除了缓存?重新加载了页面?我真的不完全确定出了什么问题,但我猜不是按钮CSS。谢谢你,我已经删除了点,按钮仍然不走运。什么都没有改变(如您在链接的演示中所见,此处“未发生任何变化”。(在本答案中)这种方法有效。那么,你是否更改了页面中的CSS?清除了缓存?重新加载了页面?我不完全确定出了什么问题,但我想这不是按钮CSS。但我尝试此操作时无法添加更多CSS按钮,但尝试此操作时也无法添加更多CSS按钮