2017-06-29 74 views
-1

我是新来的CSS。这里是我的按钮的CSS,但我需要它与图片中没有绿色背景的按钮非常相似。如果你能帮助我,我会很感激。按钮颜色错误

.button { 
 
    background-color:#333; 
 
    font-family: Arial; 
 
    color: white; 
 
    padding: 15px 32px; 
 
    text-align: center; 
 
    text-decoration: none; 
 
    display: inline-block; 
 
    font-size: 16px; 
 
    margin: -5px 0 0 100px; 
 
    cursor: pointer; 
 
    font-weight: bold; 
 
    align-items:center; 
 
    -moz-border-radius: 10px; 
 
    -webkit-border-radius: 10px; 
 
    border:1px solid #333; 
 
    border-bottom-width: 3px; 
 
    -webkit-box-shadow: 2px 5px 3px 2px #333; 
 
    -moz-box-shadow: 2px 5px 3px 2px #333; 
 
    box-shadow: 2px 5px 3px 2px #333; 
 
}
<button class="button">Access our old platform</button>

Image of button without the background

回答

2

<!DOCTYPE html> 
 
<html> 
 
<head> 
 
    <meta charset="utf-8"> 
 
    <meta name="viewport" content="width=device-width"> 
 
    <title>JS Bin</title> 
 
    <style> 
 
    button { 
 
    background-color:#333; 
 
    font-family: Arial; 
 
    color: white; 
 
    padding: 18px 32px; 
 
    text-align: center; 
 
    text-decoration: none; 
 
    display: inline-block; 
 
    font-size: 16px; 
 
    margin: -5px 0 0 100px; 
 
    cursor: pointer; 
 
    font-weight: bold; 
 
    align-items:center; 
 
    -webkit-border-radius: 10px; 
 
    border:1px solid #333; 
 
    border-bottom-width: 3px; 
 
    box-shadow: 2px 5px 3px 2px #333; 
 
} 
 
    </style> 
 
</head> 
 
<body> 
 
<div> 
 
    <button classname="button">Access our old platform</button> 
 
    </div> 
 
</body> 
 
</html>

+1

感谢那对我的工作,伟大的人,你拯救我的一天 –

3

.button { 
 
    background: linear-gradient(to bottom, #55585e 0%,#28343b 100%); 
 
    font-family: Arial; 
 
    color: white; 
 
    padding: 15px 32px; 
 
    font-size: 16px; 
 
    cursor: pointer; 
 
    font-weight: bold; 
 
    border-radius: 10px; 
 
}
<button class="button">Access our old platform</button>