2017-03-18 60 views
-3

我想添加一些CSS到我的按鈕,由於某種原因,這是行不通的。CSS不能在我的HTML上工作

索引頁

<input style="margin-top:10px;" type="submit" class="loginButton" title="Subscribe" value="Subscribe" /> 

CSS

.loginButton { 
    -moz-box-shadow: 0px 0px 0px 1px #ffffff; 
    -webkit-box-shadow: 0px 0px 0px 1px #ffffff; 
    box-shadow: 0px 0px 0px 1px #ffffff; 
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #9e0000), color-stop(1, #ff0000)); 
    background: -moz-linear-gradient(top, #9e0000 5%, #ff0000 100%); 
    background: -webkit-linear-gradient(top, #9e0000 5%, #ff0000 100%); 
    background: -o-linear-gradient(top, #9e0000 5%, #ff0000 100%); 
    background: -ms-linear-gradient(top, #9e0000 5%, #ff0000 100%); 
    background: linear-gradient(to bottom, #9e0000 5%, #ff0000 100%); 
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#9e0000', endColorstr='#ff0000',GradientType=0); 
    background-color: #9e0000; 
    -moz-border-radius: 2px; 
    -webkit-border-radius: 2px; 
    border-radius: 2px; 
    border: 1px solid #1c0101; 
    display: inline-block; 
    cursor: pointer; 
    color: #ffffff; 
    font-family: Trebuchet MS; 
    font-size: 18px; 
    padding: 18px 44px; 
    text-decoration: none; 
    text-shadow: 0px 1px 0px #000000; 
}  

那會是什麼?正如我之前使用過這種風格。

+0

究竟是不是工作?所有的 ? – aeid

+1

我不明白。它對我來說非常合適。這是你想要的結果:https://jsfiddle.net/NikolaosG/6crb2nof/? –

+0

你的CSS是否被正確包含?該類與HTML中的按鈕類匹配,所以它應該沒有問題。 –

回答

0

它工作得很好,我

enter image description here

仔細檢查你的CSS路徑和類層次結構。

0

它的工作。確保包括外部CSS正確的路徑,或者如果您正在使用的HTML文件中,務必註明的CSS腳本中 <style type="text/css"></style>

https://i.stack.imgur.com/NkrJ8.jpg

0

嗨它工作正常,並請仔細檢查你的代碼,如果不只是添加css類,如下圖所示(以input添加類)

input.loginButton{ /*HERE YOU CAN ADD YOUR CSS CODE*/}