入力フィールドにサブミットボタンを入れようとしました。 「通常の」送信ボタンを使用する代わりに、入力フィールドに小さなアイコンを挿入しようとしましたが、成功しませんでした。私は入力フィールドの中にイメージ(寸法30 * 30ピクセル)を得ることができませんでした。HTML5/CSS入力フィールド(入力フィールド内にサブミットボタンとして画像がある)
<!DOCTYPE html>
<html>
<head>
<style>
input[type=text] {
position: relative;
width: 200px;
height: 36px;
box-sizing: border-box;
border: 2px solid #4d7fc3;
border-radius: 4px;
font-size: 16px;
background-color: white;
padding: 2px 2px 2px 10px;
}
input[type=submit] {
position: absolute
width: 30px;
height: 30px;
top: 0px;
right: 0px;
/* background-color: #4d7fc3; */
border: none;
color: white;
background-image: url('file:///C|/Users/heilemann/Pictures/LoginPfeil.JPG');
display: block;
background-position: 100px 100px 100px 100px; */
/* background-repeat: no-repeat; */
/* padding: 2px 2px 2px 30px; */
z-index: -1;
margin: 10px;
cursor: pointer;
}
</style>
</head>
<body>
<p>Input with icon:</p>
<form>
<div id="Search">
<input type="text" name="search" placeholder="Search..">
<input type="submit" value="">
</div>
</form>
</body>
</html>
それは次のようになります。それはHTMLとCSSで行われる。ここ
ています。また、画像のリンクが表示されません。 –
''を使わないのはなぜですか? – hungerstar