按钮颜色错误

时间:2017-06-29 10:20:54

标签: css

我是CSS的新手。这是我的按钮的CSS,但我需要它与图片中没有绿色背景的按钮非常相似。我有一些颜色方面的问题,如果你能帮助我会非常感激。

(defmulti attribute-type :type)
(defmethod attribute-type "string" [a] ::string-validations)
(defmethod attribute-type "int" [a] ::int-validations)

;; how to say this is a vector of int-min-validation, or int-max-validation etc.
;; (s/+ ...) and (s/or ...) maybe?
(s/def ::int-validations (...) 
(s/def ::string-validations (...)

;; not sure how to incorporate these...    
(s/def ::int-min-validation (s/keys :req-un [::min]))
(s/def ::int-max-validation (s/keys :req-un [::max]))
(s/def ::string-presence-validation (s/keys :req-un [::presence])) 

(s/def ::attribute (s/multi-spec attribute-type ::type))

(s/explain ::attribute int-attr)
(s/explain ::attribute string-attr)
.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;
}

Image of button without the background

2 个答案:

答案 0 :(得分: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>

答案 1 :(得分: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>