HTML input direction rtl

511
July 22, 2017, at 09:45 AM

I am creating a calculator app, and on my display section where you can see the entered number I'm using HTML input type text. I changed the direction to RTL, but now when I enter the first number, it is not possible to see the full number, because the number is in kind of italic font.

I'm trying to push the number to the left to make some kind of padding, but no success. Here is a screenshot.

Answer 1

div{ 
  width:50px; 
  height:20px; 
  border:1px solid black; 
  direction:rtl; 
  padding:0 5px; 
}
<div> 
  <i>777</i> 
</div>

Answer 2

input{ 
  text-align:right; 
  font-style: italic;   
}
<input type='text' value='777' readonly>

use text-align:right;

Answer 3
input[type="text"] {
   text-align: right;
   padding-right: 14px;
   font-style: italic;
}
Rent Charter Buses Company
READ ALSO
I need to create multiple instances of my CSS class in js

I need to create multiple instances of my CSS class in js

I have a base class called toast in CSS that includes all of my basic styling, with a javascript function that is passed a type of toast to create based on user input in order to give feedbackThis function edits my toast class and adds in some icons and text as shown below:

237
Page layout different on 1st load in chrome

Page layout different on 1st load in chrome

I'm trying to get a job as a developerI've made a personal website to show employers but I've got a bug

244
How to get the closest id?

How to get the closest id?

In a iOS APP, There is a webView contains many text linesBy now, I use javascript to detect which text is clicked by user

373