Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to fix element in place on mobile
    text
    copied!<p>I've developed a web-application. Unfortunately, i met with some problem in terms of positioning.</p> <p>As you can see from the image below, the mobile keyboard of my samsung s4 on google chrome caused my element from shifting beyond my header. </p> <p><img src="https://i.stack.imgur.com/4j9zI.png" alt="enter image description here"></p> <p>However, when i tested it on iPhone 4 with safari, this doesn't happen. Unfortunately, when i tested it on iPhone 4 with google chrome, the same problem persist. </p> <p>This is how my html of my login page looks like</p> <pre><code>&lt;div id="loginpage"&gt; &lt;table id="loginpage1" width="100%"&gt; &lt;tr&gt; &lt;td&gt; &lt;h2&gt;Login&lt;/h2&gt; &lt;br /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;b&gt; Username : &lt;/b&gt; &lt;asp:TextBox ID="txtUsername" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;br /&gt; &lt;br /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;b&gt; Password : &lt;/b&gt; &lt;asp:TextBox ID="txtPassword" runat="server" TextMode="Password" &gt;&lt;/asp:TextBox&gt; &lt;br /&gt; &lt;br /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;table id="loginpage2" width="50%" align="center"&gt; &lt;tr&gt; &lt;td align="right"&gt; &lt;b&gt;Account Type :&lt;/b&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:RadioButton ID="rbMember" runat="server" GroupName="rbGroup1" Text="Member" /&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:RadioButton ID="rbPolice" runat="server" GroupName="rbGroup1" Text="Officer" /&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:RadioButton ID="rbAdmin" runat="server" GroupName="rbGroup1" Text="Admin" /&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:RadioButton ID="rbSuperior" runat="server" GroupName="rbGroup1" Text="Superior" /&gt; &lt;/td&gt; &lt;td&gt; &lt;asp:RadioButton ID="rbPoliceStaff" runat="server" GroupName="rbGroup1" Text="PoliceStaff" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="6" &gt; &lt;b&gt;&lt;asp:Label ID="lblMessage" runat="server" &gt;&lt;/asp:Label&gt;&lt;/b&gt; &lt;br /&gt; &lt;br /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="6"&gt; &lt;asp:Button ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click" /&gt; &lt;br /&gt; &lt;br /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="6"&gt; &lt;asp:LinkButton ID="lbtnMemberRegister" runat="server" OnClick="lbtnMemberRegister_Click"&gt;Register&lt;/asp:LinkButton&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; </code></pre> <p>Here's my css </p> <pre><code>#loginpage { position:absolute; margin-top:-15%; overflow:hidden; } </code></pre> <p>I used <code>overflow:auto</code> as well but it still the same. I attempted to change my <code>position</code> to <code>relative</code> but it doesn't work as well. I've added the <code>margin-top:-15%;</code> so as to align my login just slightly below my header without the mobile keyboard. But with the keyboard, it would look like the image i posted above. Therefore, i need to fix my element in it's original position. </p> <p>Does anyone have any idea on how to solve this problem?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload