Shrikantha Budya
Shrikantha Budya

Reputation: 644

textarea changes font-size according to the screen size

I don't know what happens in a desktop browser but in Android default browser when i keep the width and height as 100% The font size of the textarea increases according to the screen I tried to alert the font - size of the textarea but it doesn't change .I think this is a bug in the browser if not is there a way to fix this issue ?

Any help would be appreciated.

The code is simple it is:

<textarea></textarea>
<style>
  textarea{
   width:100%;
   height:100%;
   font-size:16px;
  }
</style>
<script>
  alert($("textarea").css("font-size"));//uses jquery
  //Outputs 16
</script>

I have noticed that the font size starts changing after the width becomes more than ~450px

Upvotes: 0

Views: 318

Answers (2)

Hamed mayahian
Hamed mayahian

Reputation: 2323

i think the problem related to :

<meta name="viewport" content="width=device-width, initial-scale=1">

simply check <head> tag and remove that if exist --not Recommended --

  • another reason maybe related to css media Query check the media queries in stylesheet and change the font-size

Upvotes: 0

Denis Matafonov
Denis Matafonov

Reputation: 2802

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

Disable zoom.

Upvotes: 2

Related Questions