我的div类div表出错

时间:2014-02-19 12:46:57

标签: css

    <div id="apDiv"><table width="100%" class="flat-table flat-table-1">
                        <tbody>
                            <tr>
                                <th style="width:10px"><font color="#003300">NAME</font></th>
                                <th style="width:200px"><font color="#003300">LICENSE#</font></th>
    <th style="width:200px"><font color="#003300">PLATE#</font></th>
                                <th style="width:5px"><font color="#003300">OFFENSES</font></th>
                                <th style="width:150px"><font color="#003300">OFFICER</font></th>
                                <th style="width:150px"><font color="#003300">RANK</font></th>
    <th style="width:200px"><font color="#003300">VIOLATION</font></th>
                                 <th style="width:200px"><font color="#003300">CONFISCATED</font></th>
                                 <th style="width:200px"><font color="#003300">V.PLACE</font></th>
                              <th style="width:500px"><font color="#0000CC">LAST UPDATE</font></th>
                            </tr>
                        </tbody>


         <?php
         date_default_timezone_set('Asia/Manila');
                        $conn=mysql_connect("localhost","root","");
                        mysql_select_db("dbposo",$conn);


            $violationz=mysql_query("select *,date_format(ttime,'%h:%i %p') as timed from tblviolator ORDER BY ddate DESC") or die(mysql_error());

                        while($data=mysql_fetch_array($violationz))
                            {
                                $license=$data['license'];
                                $link=str_replace(" ","-",$license);
                                $fname=$data['fname'];
                                $mname=$data['mname'];
                                $lname=$data['lname'];
                                $plateno=$data['plateno'];
                                $offenses=$data['offenses'];
                                $type=$data['type'];
                                $officer=$data['officer'];
                                $violation=$data['violation'];
                                $confiscated=$data['confiscated'];
                                $violationplace=$data['violationplace'];
                                $ddate=$data['ddate'];
                                $ttime=$data['ttime'];


                                print "
                                    <tr license='X$license'>
                                    <td width='10px'><center><font size='1'>$lname,$fname,$mname</center></td>
                                    <td width='200px'><center><a href='edit_publicviolation.php?n=$link'><font color='#00FF00'>$license</font></a></center></td>
                                    <td width='90px'><center>$plateno</center></td>
                                    <td width='50px'><center>$offenses</center></td>
                                    <td width='530px'><center>$officer</center></td>
                                    <td width='280px'><center>$type</center></td>
                                    <td width='280px'><center>$violation</center></td>
                                    <td width='280px'><center>$confiscated</center></td>
                                    <td width='280px'><center>$violationplace</center></td>
                                    <td width='200px'><center>$ddate $ttime</center></td></tr>
                                    ";
                            }

                                    ?>  
    </table>

this is my CSS

<style type="text/css">
#apDiv {
    position:absolute;
    width:1313px;
    height:233px;
    z-index:2;
    left: 35px;
    top: 299px;
}
 .flat-table {

        margin-bottom: 20px;
        border-collapse:collapse;
        font-family: 'Lato', Calibri, Arial, sans-serif;
        border: none;
                border-radius: 3px;
               -webkit-border-radius: 3px;
               -moz-border-radius: 3px;
    }
    .flat-table th, .flat-table td {
        box-shadow: inset 0 -1px rgba(0,0,0,0.25), 
            inset 0 1px rgba(0,0,0,0.25);
    }
    .flat-table th {

        font-weight: normal;
        -webkit-font-smoothing: antialiased;
        padding: 1em;
        color: rgba(0,0,0,0.45);
        text-shadow: 0 0 1px rgba(0,0,0,0.1);
        font-size: 1.5em;
    }
    .flat-table td {
        color: #f7f7f7;
        padding: 0.7em 1em 0.7em 1.15em;
        text-shadow: 0 0 1px rgba(255,255,255,0.1);
        font-size: 1.2em;
    }
    .flat-table tr {
        -webkit-transition: background 0.3s, box-shadow 0.3s;
        -moz-transition: background 0.3s, box-shadow 0.3s;
        transition: background 0.3s, box-shadow 0.3s;
    }
    .flat-table-1 {
        background: green;
    }
    .flat-table-1 tr:hover {
        background: rgba(0,0,0,0.19);
    }
    .flat-table-2 tr:hover {
        background: rgba(0,0,0,0.1);
    }
    .flat-table-2 {
        background: #f06060;
    }
    .flat-table-3 {
        background: #52be7f;
    }
    .flat-table-3 tr:hover {
        background: rgba(0,0,0,0.1);
    }

</style>

我如何制作div,插入我的CSS?

因为它会阻挡屏幕,但原件仍在那里,没有任何反应。

它阻止屏幕的每个记录插入,我怎么能用我的CSS修复它?

请帮忙。

这是图片http://waaaaaas.weebly.com/

的链接

2 个答案:

答案 0 :(得分:0)

你必须在某个地方关闭你的div,否则你的浏览器会将下面的整个部分解释为div的一部分。

答案 1 :(得分:0)

#apDiv {
    position:absolute;
    width:1313px;
    height:233px;
    z-index:2;
    left: 35px;
    top: 299px;
}

你的div(包含表格)在页面上方“浮动”(重叠你的页脚),因为你告诉它。这就是设置位置:绝对的作用 - 它将所讨论的元素从页面的正常流程中取出,并将其独立定位。如果您不希望它执行此操作,则上面部分中的大多数CSS都是不必要的。相反,请尝试简单:

#apDiv {
    width:1313px;
    height:233px;
}

看看它是否符合您的要求 - 此时它不应再与页脚重叠。你几乎肯定需要更多地摆弄这个,但是位置:绝对绝对不是你想要的。