在移动设备上开始键入时输入类型长度增加

时间:2016-10-04 11:47:35

标签: html css mobile responsive-design

我正在尝试在移动设备上为网站创建一个简单的联系表单。表格在桌面上工作正常但是当我在智能手机/移动设备上打开时,字段的长度正在增加。请看图片

Image 1 | Image 2 | Image 3

  1. 第一张图片显示我们在移动设备上打开网页时的第一个图片
  2. 第二个是我尝试添加值
  3. 当我完成前两个字段的值时
  4. 我正在做的代码

      
        @media only screen and (min-device-width : 360px) and (max-device-width : 640px) and (orientation : portrait)
    {
        .table tr td input[type="text"],
        .table tr td input[type="email"]
        {
        	width: 250px;
        }
        
        .table tr td input[type="text"]:focus,
        .table tr td input[type="email"]:focus
        {
        	border: 1px solid #f15b25;
        }
    }
    
    @media only screen and (min-device-width : 360px) and (max-device-width : 640px) and (orientation : landscape)
    {
    .left_bottom table tr td input[type="text"],
    .left_bottom table tr td input[type="email"]
    {
    	width: 480px;
    	margin-left:1.5%;
    }
    
    .left_bottom table tr td input[type="text"]:focus,
    .left_bottom table tr td input[type="email"]:focus
    {
    	border: 1px solid #f15b25;
    }
    }
    <form action="" method="post" enctype="multipart/form-data">
          <table>
            <tr>
              <td><input type="text" placeholder="Name" name="senderName" class="wdlp_form" required /></td>
            </tr>
            <tr>
              <td><input type="email" placeholder="Email" name="senderEmail" class="wdlp_form" required /></td>
            </tr>
          </table>

0 个答案:

没有答案