dtuct88226 2015-11-12 21:31
浏览 18
已采纳

在移动设备上选择输入文本时,不会将输入文本居中

Is there a way to not center the input text in the middle of the screen when you're selecting it on mobile? When it does that, you have to keeping scrolling up to read the text above it after you press enter, which is not good.

<head>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
</head>

//a div containing text from an ajax call after entering the input text
<input type = "text">
  • 写回答

3条回答 默认 最新

  • duangu9997 2015-11-12 22:00
    关注

    Use css to pull the text where you want it.

    wrap the text in a div and then position it where you want it. That way your ajax shouldn't have any effect on where it ends up.

    <div id="ajaxCall" class="fixText">
      Ajax call
    </div>
    

    attributes like the ones below help you move text around:

    #ajaxCall{
      text-align: left;
      position: relative / absolute;
      margin-top / bottom: 0;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本