【问题标题】:Client wants following css button [closed]客户想要关注css按钮[关闭]
【发布时间】:2019-07-08 03:42:32
【问题描述】:

我在为按钮创建以下 css 样式时需要帮助,不知道如何添加不同的背景并在它们之间添加间距。

http://i64.tinypic.com/df9936.jpg

【问题讨论】:

  • 使用线性渐变。
  • 您可以使用此工具来帮助您创建渐变cssgradient.io
  • 我知道如何使用线性渐变,但不知道如何实现不同颜色之间的白色间距

标签: css button


【解决方案1】:

您可以使用 css 线性渐变来做到这一点。请参见下面的示例。

button {
  padding: 20px 40px;
  font-size: 16px;
  color: #FFF;
  padding-left: 10px;
  border:none;
  background: linear-gradient(to right, rgba(255,38,0,1) 0%, rgba(246,41,12,1) 74%, rgba(255,255,255,1) 75%, rgba(255,255,255,1) 77%, rgba(255,111,0,1) 78%, rgba(255,111,0,1) 87%, rgba(255,255,255,1) 88%, rgba(255,255,255,1) 89%, rgba(247,255,0,1) 93%, rgba(247,255,0,1) 100%);
}
button:focus {
  outline:none;
}
<button>Explore</button>

【讨论】:

    【解决方案2】:

    下载下面的图片并将其命名为 button-1,然后使用下面的 html。图像将成为链接,您无需使用空白区域。

    <a href="http:www.google.com">
      <img src="button-1.jpg" alt="imagelink" style="width:42px;height:42px;border:0;">
    </a> 
    

    【讨论】:

    • 不知道为什么这被否决了?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-10
    相关资源
    最近更新 更多