入力の右側にアイコンを配置して、コンボのようにしたいです。完全なコードでなければならないため、相対位置を使用する必要があります。そして、jQuery プラグインを作成し、どこでも使用します。
これは私のコードです。Firefox と Chrome では正しく表示されますが、IE-9 には問題があります。アイコンを実行margin-top -15px
すると少し下になり、-16px を実行すると入力の上に移動します。
どうすればこの問題を解決できますか?
<!DOCTYPE HTL>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>
<div style="width:50%; position:relative; top:0; left:0; height:0; background-color:#ccc;">
<input class="rounded" type="text" style="width:100%;">
<img src="https://placehold.it/77" style="position:relative; z-index:2; float:right; margin-top:-16px; padding-right:5px;" />
</div>
</body>
</html>