Text being cut in iphone

喜夏-厌秋 提交于 2021-01-29 05:34:22

问题


I am having problems with textarea and input type text in ios devices. The bottom part of the text gets cuts off. How can i fix the text so it is displayed fully ?

Here is the css:

textarea {
width: 97%;
padding: 5px 1.5%;
height: 70px;
line-height: 150%;
border: 1px solid #ccc;
}

回答1:


Define the height in "em", no "px" ... Pixels tell the browser the textarea height should be 70px, in EMs you tell the browser the height should be 5 rows for example (height: 5em;).




回答2:


Can you try this one. I tested it on iPhone as well and it will work fine. Please check it at your site.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name = "viewport" content = "initial-scale = 2.3, user-scalable = no">
<title>Untitled Document</title>
<style>
body {
    width: 100%;
}
textarea {
    width: 97%;
    padding: 5px 0.5%;
    height: 5em;
    line-height: 1.5em;
    border: 1px solid #ccc;
}
</style>
</head>

<body>
<textarea>
</textarea>
</body>
</html>


来源:https://stackoverflow.com/questions/23147638/text-being-cut-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!