CSS没有外部样式表的样式

时间:2015-03-31 01:11:13

标签: css

我从这个网站获得了一些CSS按钮:http://www.bestcssbuttongenerator.com。  我把代码放在样式表中。现在,当我尝试为这些按钮应用样式时,它们不起作用。但是,当我将CSS放在style标记之间的内联样式表中时,它们执行工作。知道为什么吗?

<span id="">
<span id="some-id">Some text...</span>

</span>
<a href="#"><span class="button">Some text...</span></a><br>

<style>
.button {
-moz-box-shadow:inset 0px 1px 0px 0px #54a3f7;
-webkit-box-shadow:inset 0px 1px 0px 0px #54a3f7;
box-shadow:inset 0px 1px 0px 0px #54a3f7;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #007dc1), color-stop(1, #0061a7));
background:-moz-linear-gradient(top, #007dc1 5%, #0061a7 100%);
background:-webkit-linear-gradient(top, #007dc1 5%, #0061a7 100%);
background:-o-linear-gradient(top, #007dc1 5%, #0061a7 100%);
background:-ms-linear-gradient(top, #007dc1 5%, #0061a7 100%);
background:linear-gradient(to bottom, #007dc1 5%, #0061a7 100%);

background-color:#007dc1;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
border:1px solid #124d77;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Courier New;
font-size:13px;
font-weight:bold;
padding:20px 24px;
text-decoration:none;
text-shadow:0px 1px 0px #154682;
}
.button:hover {
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #0061a7), color-stop(1, #007dc1));
background:-moz-linear-gradient(top, #0061a7 5%, #007dc1 100%);
background:-webkit-linear-gradient(top, #0061a7 5%, #007dc1 100%);
background:-o-linear-gradient(top, #0061a7 5%, #007dc1 100%);
background:-ms-linear-gradient(top, #0061a7 5%, #007dc1 100%);
background:linear-gradient(to bottom, #0061a7 5%, #007dc1 100%);

background-color:#0061a7;
}
.button:active {
position:relative;
top:1px;}
</style>

1 个答案:

答案 0 :(得分:0)

在HEAD标记中的所有其他CSS文件之后放置CSS的链接。它将变得更具级联性。

此外,覆盖按钮的特定ID #addToChrome-button,以传递设置它所需的所有属性。 使用此链接作为css specificity

的参考