Avoid zooming within a textarea

0

Good afternoon guys,

I have the following problem and I did not know how to describe a title well, I have a field that has a textarea that fits the page width with 98%. What I want to avoid is that when the user clicks inside the zoom textarea, what is happening is that when he clicks to type the page gets much bigger and creates such a horizontal scrollbar.

  • On a mobile device

Does anyone have any tips?

    
asked by anonymous 25.02.2016 / 19:37

2 answers

0

First of all do not forget the viewport .. if you do not have it, you do not need to read more, there is your problem;)

In css there is :focus can use this to work the element when it is focused and when it is on the mobile

@media (min-width:500px){
    textarea:focus{
        ...
    }
}

This way you can adjust the height as you want;) It would still be easier to explain and / or prove my reasoning (I did not test, I'm just trying to see your problem) if you leave a little bit of your code:)

Hugs and good luck!

    
25.02.2016 / 20:03
0

A heavily used hack is to set the font size to 16px .

@media screen and (max-width: 640px){
   textarea {
       font-size: 16px;
   }
}

Apple devices zoom in the fields to focus until the text is displayed on the screen with the size of 16px . Setting this value from scratch does not happen.

Source: link

    
25.02.2016 / 21:54