【问题标题】:How to make a simple contact form input box responsive如何让一个简单的联系表单输入框响应式
【发布时间】:2017-03-14 05:15:07
【问题描述】:

我正在学习如何制作响应式网站..

我找到了一个足以满足我们需求的小型/简短的联系表单脚本。

这里的“消息”输入框没有响应。

活动页面位于http://qtest.pw

<div id="ContactWrapper">
<div id="ContactDiv1">  
<h2>Request an Appointment</h2>                 
<?php
$action=$_REQUEST['action'];
if ($action=="")    /* display the contact form */
    {
    ?>
    <form  action="" method="POST" enctype="multipart/form-data">
    <input type="hidden" name="action" value="submit">
    Your name:<br>
    <input name="name" type="text" value="" size="30"/><br>
    Your phone number:<br>
    <input name="phone" type="text" value="" size="30"/><br>
    Your email:<br>
    <input name="email" type="text" value="" size="30"/><br>
    Your request:<br>
    <textarea name="message" rows="4" cols="70"></textarea><br>
    <input type="submit" value="Send email"/>
    </form>
    <?php
    } 
else                /* send the submitted data */
    {
    $name=$_REQUEST['name'];
    $phone=$_REQUEST['phone'];
    $email=$_REQUEST['email'];
    $message=$_REQUEST['message'];
    if (($name=="")||($phone=="")||($email=="")||($message==""))
        {
        echo "All fields are required, please fill <a href=\"\">the form</a> again.";
        }
    else{       
        $from="From: $name<$email>\r\nReturn-path: $email";
        $subject="Appointment Request from Webpage for $name at $phone";
        mail("helmichfrontdesk@gmail.com", $subject, $message, $from);
        echo "Thank you for your Request. Your Email was sent! We will get back to you within one Business Day";
        }
    }  
?>

CSS

#ContactWrapper {
    clear: both;
    margin: auto;
    max-width: 1232px;
    display: block;
    padding-left: calc((100% - 1232px)/2);
    padding-right: calc((100% - 1232px)/2);
}
#ContactDiv1 {
    clear: none;
    float: left;
    margin-left: 0;
    width: 46%;
    display: block;
    margin-right: 2%;
    padding-bottom: 4%;
}

【问题讨论】:

    标签: html css fluid-layout


    【解决方案1】:

    制作您的表单元素width:100%

    textarea{
      width:100%;
    }
    

    【讨论】:

    • 我会把它放在哪里?
    • @CompStuff 你的谷歌地图右侧有额外的空间。是否有必要,因为它使您的页面滚动宽度更小。把它放在你的 CSS 上。
    • 我试过
      并且成功了.. 谢谢
    • 地址提交后右边的空间是路线
    • @CompStuff 有必要放在右边吗?因为它使您的页面可以在较小的宽度上滚动。
    猜你喜欢
    • 2019-05-27
    • 2016-11-21
    • 2014-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-27
    相关资源
    最近更新 更多