我有一个带有 SVG 图像的按钮。我已成功为 div
添加图像,但不确定如何将其应用于输入标签。
例如:
.formLink {
text-align: center;
display: inline-block;
margin: 0 0 88px;
transition: all .25s ease;
max-width: 100%;
box-sizing: border-box;
background: linear-gradient(to right, #e82171, #ef3e36);
padding: 24px 40px;
border-radius: 100px;
-webkit-border-radius: 100px;
-moz-border-radius: 100px;
font-size: 18px;
color: #fff;
text-decoration: none;
font-family: 'GeomanistRegular', sans-serif;
cursor: pointer;
font-weight: 900;
line-height: 1em;
margin-right: 0;
margin-left: 0;
transition: all .6s;
}
i.arrow {
background: no-repeat;
background-image: url(https://cdn2.hubspot.net/hubfs/548247/Tomorrow%20People/Landing%20Page/Template%20Build/Arrow.svg);
padding: 7px;
margin: 4px 0 4px 10px;
float: right;
transition: all 0.2s;
}
/***********/
input {
text-align: center;
display: inline-block;
margin: 28px 0 1em;
transition: all .25s ease;
max-width: 100%;
box-sizing: border-box;
padding: 24px 1.2em;
width: 220px;
border-radius: 50px;
-webkit-border-radius: 50px;
-moz-border-radius: 50px;
font-size: 18px;
color: #fff;
text-decoration: none;
font-family: 'GeomanistRegular', sans-serif;
cursor: pointer;
font-weight: 900;
line-height: 1em;
background: linear-gradient(to right, #e82171, #ef3e36);
border: 0;
transition: all .6s;
/*background: url(https://cdn2.hubspot.net/hubfs/548247/Tomorrow%20People/Landing%20Page/Template%20Build/Arrow.svg) no-repeat scroll 14px 7px;
background-size: 20px;*/
}
<div class="formLink">Download now <i class="arrow"></i></div><br>
<input type="submit" value="Send Message" class="hs-button primary large" data-reactid=".hbspt-forms-0.4.1.0">
如您所见,我已尝试将 background:url
添加到输入中,但它隐藏了我的整个按钮?
我基本上希望发送消息按钮看起来像立即下载按钮。
想法? 我无法更改输入的 HTML。需要通过 CSS 来实现
最佳答案
这是一个工作示例 http://jsfiddle.net/xpvt214o/328055/
<div class="formLink">Download now <i class="arrow"></i></div><br>
<button type="submit" value="Send Message" class="hs-button primary large formLink" data-reactid=".hbspt-forms-0.4.1.0"> Send Message<i class="arrow"></i></button>
关于html - 将图像添加到输入类型提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51097953/