当前位置: 代码迷 >> PHP >> CSS中设立的部分参数link后无法读取使用
  详细解决方案

CSS中设立的部分参数link后无法读取使用

热度:67   发布时间:2016-04-28 18:16:31.0
CSS中设置的部分参数link后无法读取使用
我用link方式连接CSS文件后,table主体参数好像没有起作用,但是th td的参数起作用了,为什么啊,比如
border-collapse这个参数,在CSS里面已经设置好了,但是无效,我就把它单独摘出来放到PHP网页里面,这下倒是起作用了,谁知道为什么啊~··谢谢
CSS代码
<style type="text/css">
table.gridtable {
font-family: verdana,arial,sans-serif;
font-size:11px;
color:#333333;
border-width: 1px;
border-color: #666666;
border-collapse: collapse;
}
table.gridtable th {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #666666;
background-color: #dedede;

}
table.gridtable td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #666666;
background-color: #ffffff;
}

</style>

============================
php代码
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/3.css"/>
<style type="text/css">
table.gridtable 
{
border-collapse: collapse
}
</style>
<table class="gridtable" >


<tr><th>账号1</th><th>用户名1</th><th>密码1</th></tr>
<?php
mysql_connect("localhost", "root", "a");
mysql_select_db("zhanghao");

/* 查找test1表中ID为1的那行所有的数据 */
$sql = "SELECT * FROM 宿舍";

/* 执行查找 */
$result = mysql_query($sql);
$row=mysql_num_rows($result);//返回取得的数据列的数目
if($row){                 //判断数据库中是否有值
while($row2=mysql_fetch_array($result)){       //注意括号结束的位置


$账号=$row2['账号'];
$用户名=$row2['用户名'];
$密码=$row2['密码'];
?>
<tr><td><?php echo $账号 ?></td><td><?php echo $用户名 ;?></td><td><?php echo $密码;?></td></tr>
<?php }           //while循环结束的括号
}             //if结束的括号
?>
</table>

------解决思路----------------------
CSS文件中不需要写style标签的直接写样式表的,你这样写肯定引入无效。
------解决思路----------------------
顶3#
  相关解决方案