gpt4 book ai didi

html - 输入文本和背景图像[类型 ='submit']

转载 作者:可可西里 更新时间:2023-11-01 13:14:17 27 4
gpt4 key购买 nike

<input name="submit" type="submit" value="Search" class="button search">

是否可以使用 background-image: 应用 CSS 渐变?仍然显示 value 中包含的文本属性?

当我添加背景图像时,它会隐藏文本。

非常感谢任何帮助

编辑

这里是匹配标记的计算样式

    -webkit-appearance: none;
-webkit-background-clip: border-box;
-webkit-background-origin: padding-box;
-webkit-background-size: auto;
-webkit-border-image: none;
-webkit-box-align: center;
-webkit-box-shadow: rgba(255, 255, 255, 0.701961) 0px 0px 6px 0px inset, rgba(0, 0, 0, 0.0980392) 0px 2px 3px 0px;
-webkit-font-smoothing: antialiased;
-webkit-rtl-ordering: logical;
-webkit-transition-delay: 0s;
-webkit-transition-duration: 0.30000001192092896s;
-webkit-transition-property: all;
-webkit-transition-timing-function: linear;
-webkit-user-select: text;
background-attachment: scroll;
background-clip: border-box;
background-color: transparent;
background-image: -webkit-linear-gradient(top, #FF8F25 0%, #FF6D00 100%);
background-origin: padding-box;
background-position: 0% 0%;
background-size: auto;
border-bottom-color: #BE4B00;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-style: solid;
border-bottom-width: 1px;
border-left-color: #BE4B00;
border-left-style: solid;
border-left-width: 1px;
border-right-color: #BE4B00;
border-right-style: solid;
border-right-width: 1px;
border-top-color: #BE4B00;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-top-style: solid;
border-top-width: 1px;
bottom: 10px;
box-shadow: rgba(255, 255, 255, 0.701961) 0px 0px 6px 0px inset, rgba(0, 0, 0, 0.0980392) 0px 2px 3px 0px;
box-sizing: border-box;
color: white;
cursor: pointer;
display: block;
float: right;
font-family: 'Lucida Grande';
font-size: 12px;
font-style: normal;
font-variant: normal;
font-weight: 800;
height: 26px;
letter-spacing: normal;
line-height: 26px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
max-height: 24px;
outline-color: white;
outline-style: none;
outline-width: 0px;
overflow-x: hidden;
overflow-y: hidden;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 24px;
position: absolute;
right: 8px;
text-align: center;
text-indent: 0px;
text-shadow: none;
text-transform: uppercase;
vertical-align: baseline;
white-space: pre;
width: 85px;
word-spacing: 0px

已解决

是一个将文本向下推的填充问题。似乎在 Mac 上的 Chrome 中可以应用填充而不影响高度,以便将文本向下推到 View 之外。

谢谢大家的帮助

最佳答案

CSS

input {
background-color: #D28888;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#690707), to(#D28888));
background: -moz-linear-gradient(top, #690707 0%, #D28888 100%);
border:none; padding:6px 12px; color:#fff; cursor:pointer
}

DEMO


通过使用background-image

input {
background-image: url(http://alanbooth.net/alap/images/gradient.bmp);
border:none;
padding:6px 12px;
color:#fff;
cursor:pointer
}

DEMO - 2

关于html - 输入文本和背景图像[类型 ='submit'],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13467899/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com