开发者

Why is this happening to my form? (screenshots included)

开发者 https://www.devze.com 2023-01-29 07:08 出处:网络
This is my code: Enter your question here: <form method=\"post\" action=\"\"> Title: <input type=\"text\" name=\"title\">

This is my code:

Enter your question here:

    <form method="post" action="">
    Title: 
    <input type="text" name="title">

    <br>Further Explanation:<br>
    <textarea name="content" rows="5"></textarea><br>
    <input type="submit" name="input" value="Ask" />


            <?php
            if(isset($_POST['delete'])) {
                include "connection.php";
                if (mysql_query("TRUNCATE TABLE Questions"))
                {
                    echo "Pitanje je uspesno obrisano";
                } else {
                    echo "Nastala je greška pri brisanju pitanja<br>" . mysql_error();
                }

            }
            ?>

    </form>
    <form action="
    <?php
    $_SERVER['PHP_SELF'];
    ?>
    " method="post">
    <input type="submit" name="delete" value="delete all questions">
    </form>

Now, this is what should my form normally look like:

Why is this happening to my form? (screenshots included)

But this is what happens when I put in or out of the div tag inside my dynamic page file:

htt开发者_Go百科p://tinypic.com/images/404.gif

What am I doing wrong? what is going on? :(


I'm not a CSS pro, but what I'd recommend is firing this up in Firefox after you download the add-on Firebug. Firebug will let you get right in there and mess with the CSS and HTML while it is running in the browser, so you can adjust things on the fly, turn on and off css elements, and isolate exactly what is causing the problem. Just find the div in the Firebug window and it will list every css element currently attached to it. From there, you should be able to move through the code and see where that weird CSS is coming from.


You probably have some CSS rules that change the appearance of input and textarea elements, probably something like:

input, textarea {
    border: none;
}

That’s why your input and textarea elements do not have a border. And the centered align might be inherited from a parent element.

0

精彩评论

暂无评论...
验证码 换一张
取 消