2

DIVS の動作に問題があります。基本的に、div があり、div の外側に html テキストを配置しても、div の内側に表示されます。何が間違っているのかわかりません。誰かがのぞき見ることができれば、私はそれを大いに感謝します. 前もって感謝します。

html:

<div id="content">

            <p>  To submit <?php echo $_SESSION['sight_type']?> sightings, choose a location type.</p>

        <div id = "form_location_type" >`

        <form method="POST" action="location_type_input.php">
            <table>
            <tr>
            <td><input type="radio" name="location_type" value="new"  /></td><td><p> New location</p></td></tr>
            <tr>
            <td><input type="radio" name="location_type" value="saved" /></td><td><p> Saved location</p></td>
            <td><input type="submit" value="Continue"></td></tr>
            <table>
        </form>
        </div>     <!-- End form_location_type div -->
         THIS SHOULD BE OUTSIDE ABOVE DIV BUT IT PRINTS INSIDE                   
    </div> <!-- End content div -->

    <div id="footer"> <?php include 'footer.php'; ?> </div> <!-- End footer div -->

css (最も関連性が高いのは、最後のコメント セクションです)

html { height: 100%; }
body, html { min-height: 100%; height: 100%;margin : 0;
    padding : 0; }
/*html, body {
    height:auto
    height: 100%; }/* Required */



body {


    width:100%;
    line-height : 1.8em;
    color : #000000;
    background : #F5F5FF; 
    }

#container {

    position: relative;
    min-height: 100%;
    width : 800px;
    margin : 0 auto 0 auto;
    border-style: solid;
    border-width:1px;
    background : #FFFFCC;
    -moz-box-shadow: 10px 10px 5px #888888; /* shadow border */
    box-shadow: 10px 10px 5px #888888;
    }
#footer {
    clear:both;
    position:absolute;
    text-align: center;
    left:0;
    bottom: 0;
    width: 800px;
    background : #FFFFCC;
    font : 75% "Trebuchet MS", verdana, arial, tahoma, sans-serif; 

    } 

/* form on form_location_type.php */   
#form_location_type {

margin: 0 auto;
background:white;
border:solid 1px;
}
4

2 に答える 2

8

テーブルを適切に閉じていることを確認してください。

<table>
    ...
</table>

それが問題のようです: http://jsfiddle.net/RDGuY/2/

于 2012-10-07T01:17:11.353 に答える
0

テーブルが正しく閉じられていません。

追加

</table>

の代わりに

<table>

form_location_type div の最後に

さらに、form_location_type div にいくつかの下部パディングを追加してみてください:

CSS に次のコードを追加します。

#form_location_type {
  padding-bottom: 2em;
}

テキストがフォームdivから分離されているかどうかを確認してください???

于 2012-10-07T02:48:12.270 に答える