I want to show the text in my text area in any device with the same width in pixels. Means I want to set the charter width in pixels which is unique in any device (Desktop/Mobile).
<html>
<head>
<style>
textarea {
font-style: Consolas;
font-size: 20px;
line-height: 30px;
width: 264px;
height: 60px;
border: 1px solid black;
}
</style>
</head>
<body>
<textarea>Hello world. How are you Hello world. How are you</textarea>
</body>
</html>
This is my code. This not show the width of text same in all devices. I have attached a screen shot. Screen Shot comparing with the view in a mobile device
I have to work with pixels because I'm creating a real time code editor with drawing tools. Are there any CSS font properties to set to get rid of this issue or any other solutions ?
Edit:- After some searching I found that behavior happens because text rendering of browser. I change text-rendering property to available options but no use.