duanlan3598 2013-04-22 12:39
浏览 60

为什么PHP会破坏我的CSS?

screen shot

I have recently created a contact form with PHP mailer which is finally working. However the success message is breaking my page and displaying in the top left corner instead of underneath the form. As you can see below.

This is the HTML:

<form method="POST">
       <table border="1">
            <tr>
            <td><label for="name" class="g">Name</label></td>
            <td><input id="name" name="name" type="text" autofocus></td>
            </tr>

            <tr>
            <td><label for="address" class="g">Address</label></td>
            <td><textarea rows="3" id="address" name="address" cols="50"></textarea></td>
            </tr>

            <tr>
            <td><label for="number" class="g">Contact number</label></td>
            <td><input id="number" name="number" type="text" autofocus></td>
            </tr>

            <tr>
            <td><label for="email" class="g">Email</label></td>
            <td><input id="email" name="email" type="text" placeholder="example@domain.com" autofocus></td>
            </tr>

            <tr>
            <td><label for="message" class="g">Enquiry</label></td>
            <td><textarea rows="3" id="message" name="message" cols="50"></textarea></td>
            </tr>
            </table>
            <input type="submit" value="Submit" name="submit">
            <?php
            if ($success) {
                echo $success;
            }
            ?>

            </form>

It also creates a huge blank white area in the middle of my page under the form. Does anyone know why this is? or how I would go about debugging it?

  • 写回答

2条回答 默认 最新

  • dphphvs496524 2013-04-22 12:41
    关注

    You should put this in a div or a span

    <div style="text-align:center;"> <?php
            if ($success) {
                echo $success;
            }
            ?>
    </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。