1
内部に€または$ currencyの入力が必要です。私はパッディングの入力を持っています(パディング無しで問題はありません)パディングと垂直方向のアラインメントで通貨を追加する
私は完璧な垂直センタリングで何ができるのですか?
Iは、最適な結果なしにこの方法を試してみました:
1) "マージントップ:自動" と "マージン底:自動" 方法:
div {position:relative}
input {padding: 1em}
.currency {
position:absolute;
right:0.4em;
height:50%;
top:0;
bottom:0;
margin-top:auto;
margin-bottom:auto
}
<div>
<input type="text">
<span class="currency">€</span>
</div>
2)固定高さとマージントップのネガ:
div {position:relative}
input {padding: 1em}
.currency {
position:absolute;
right:0.4em;
height:3em;
top:50%;
margin-top:-1.5em;
}
<div>
<input type="text">
<span class="currency">€</span>
</div>
どちらの場合も、垂直整列は完璧に働きます。
アイデア?
http://stackoverflow.com/questions/2913236/html-text-input-field-with-currency-symbol – rsn
ます。http: //stackoverflow.com/questions/21016472/adding-dollar-prefix-to-bootstrap-input-box – Hearty
この例では、入力に埋め込みがありません – kurtko