减号在RTL文本框中 [英] Minus sign in RTL textbox

查看:90
本文介绍了减号在RTL文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在右到左文本框中显示负数,数字左边有减号?

How can I display negative numbers in right to left textbox, with the minus on the left of the number?

当前状态:1-

期望状态:-1

Current state: 1-
Desired state: -1

推荐答案

在您的文本框中,您只需重置 code>,并将文本向右对齐:

On your textbox you just need to reset the direction, and align the text to the right:

BODY {
    direction: rtl;
}
#myInput {
    direction: ltr;
    text-align: right;
}

示例fiddle here

这篇关于减号在RTL文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆