Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在上面插入文本<;输入类型=";“图像”&燃气轮机;_Html_Css_Webshop - Fatal编程技术网

Html 在上面插入文本<;输入类型=";“图像”&燃气轮机;

Html 在上面插入文本<;输入类型=";“图像”&燃气轮机;,html,css,webshop,Html,Css,Webshop,下面的代码用于将产品添加到购物篮中 我不想在输入中仅仅使用一个图像作为购买按钮,而是希望在背景中添加一个图像或填充,并在其上方添加HTML文本 <input border="0" src="/images/buy.png" type="image" /> 这是完整的代码: <span class="BuyButton_ProductInfo"> <table id=&quo

下面的代码用于将产品添加到购物篮中

我不想在输入中仅仅使用一个图像作为购买按钮,而是希望在背景中添加一个图像或填充,并在其上方添加HTML文本

<input border="0" src="/images/buy.png" type="image" />

这是完整的代码:

<span class="BuyButton_ProductInfo">
    <table id="BUYSECTION">
        <tbody>
            <tr>
                <td valign="top" align="left">Count<br />
                    <input id="amount" class="TextInputField_ProductInfo" maxlength="6" size="3" name="AMOUNT" value="1" type="text" />
                </td>
                <td>&nbsp;&nbsp;</td>
                <td class="BuyButton_ProductInfo">Buy<br />
                    <input border="0" src="/images/buy.png" type="image" />
                </td>
            </tr>
        </tbody>
    </table>
</span>

计数
购买

我不确定我是否完全理解您想要实现的目标?你能在CSS中设置
display
属性吗

#BUYSECTION input[type="image"] {  
  display:block;
}
否则,你能详细说明一下吗?也许可以提供一个链接来显示问题

已编辑

您是否想要一个可点击的提交按钮,带有图案或“按钮式”填充,但在按钮“上方”仍有不同z索引的文本

HTML:


我也不确定我是否正确理解了你的问题

但是,如果您在“提交”按钮上谈论的是纯色背景,则可以使用

<input type="submit" style="background-color: black; color: white;" value="your text" />

试试这个:

HTML:


萨卢多斯

您可以在输入元素上方插入文本。我正在为这项工作使用标签元素。可以使用CSS代码编辑标签元素的位置



单击我或图像
元素如何?像这样:另一种选择是绝对定位其中一个或两个,但当启动按钮上的单击事件时,这可能会产生意想不到的后果。感谢您的回复,我需要的是:而不是图像,其中文本是图像按钮的一部分。我想在上面放一个图像和HTML文本,然后上面的标记和样式就可以了。文本之间的。。。将显示,并且背景将使用CSS呈现。这不是OP所要求的。他希望在背景中有一个图像,在前景中有一个文本。
button{
  /* reset the button style properties */
  border:0;
  display:block;
  /* include the image and dimensions */
  width:50px;
  height: 20px;
  background:transparent url("images/buy.png") no-repeat 50% 50%;
  /* format the text */
  text-align:center;
  padding:5px;
  font-weight:bold;
  color:#333;
}
<input type="submit" style="background-color: black; color: white;" value="your text" />
<input type="button" value="Texto del boton" class="imgButton" />​
.imgButton{
background-image:url(/images/buy.png);
width: 100%;
heigth: 100%;    
}​