PHP网页嵌套出错。急!!!
我想要的效果如下:在main.php(首页)镶嵌news.php(新闻),单个网页测试没问题,但是我把news.php镶嵌进去后发现CSS都乱了,请问应该怎么改?main...
我想要的效果如下:在main.php(首页)镶嵌news.php(新闻),单个网页测试没问题,但是我把news.php镶嵌进去后发现CSS都乱了,请问应该怎么改?
main.php代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
/*navibar*/
*{ margin:0; padding:0;}
body{ font-size:12px; line-height:18px;}
li{ list-style:none;}
#nav{ position:relative; width:550px; margin:1em 0 10px 200px; height:30px;}
#nav ul{ position:absolute;}
#nav ul li{ float:left; display:inline; width:120px; height:18px; padding-top:4px; overflow:hidden; margin:0 2px; text-align:center; background:#F5F5F5; color:#990; border:1px solid #EEE8DD; cursor:pointer; }
#nav ul .nav-on{height:auto;}
#nav ul li ul{ position:static;}
#nav ul li ul li{ display:block; padding:0; margin:0; height:27px; border:none;}
#nav ul li ul li a{ display:block; height:18px; padding:5px 0 4px; color:#666; text-decoration:none;}
#nav ul li ul li a:hover{ background:#539D26; color:#fff;}
#nav ul li a{text-decoration:none;color:#990; }
#middle{ margin-top:300px;}
</style>
</head>
<body >
<div id="nav">
<ul>
<li><a href="index.php">HOME</a></li>
<li onmouseover="this.className='nav-on'" onmouseout="this.className=''">SSSS
<ul>
<li><a href="4.php" >AAAA</a></li>
<li><a href="5.php" >BBBB</a></li>
<li><a href="6.php" >VVVV</a></li>
</ul>
</li>
<li onmouseover="this.className='nav-on'" onmouseout="this.className=''">ABOUT
<ul>
<li><a href="1.php" >EEEEE</a></li>
<li><a href="2.php" >RRRRR</a></li>
<li><a href="3.php" >YYYYY</a></li>
</ul>
</li>
</ul>
</div>
<div id="middle"> <p><?php include("news.php") ?> </p></div>
</body>
</html>
news.php代码如下:http://202.122.102.179/KEN/NEWS.TXT
错误的显示如图上部分,我希望做成图下半部分的样子,谢谢! 展开
main.php代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
/*navibar*/
*{ margin:0; padding:0;}
body{ font-size:12px; line-height:18px;}
li{ list-style:none;}
#nav{ position:relative; width:550px; margin:1em 0 10px 200px; height:30px;}
#nav ul{ position:absolute;}
#nav ul li{ float:left; display:inline; width:120px; height:18px; padding-top:4px; overflow:hidden; margin:0 2px; text-align:center; background:#F5F5F5; color:#990; border:1px solid #EEE8DD; cursor:pointer; }
#nav ul .nav-on{height:auto;}
#nav ul li ul{ position:static;}
#nav ul li ul li{ display:block; padding:0; margin:0; height:27px; border:none;}
#nav ul li ul li a{ display:block; height:18px; padding:5px 0 4px; color:#666; text-decoration:none;}
#nav ul li ul li a:hover{ background:#539D26; color:#fff;}
#nav ul li a{text-decoration:none;color:#990; }
#middle{ margin-top:300px;}
</style>
</head>
<body >
<div id="nav">
<ul>
<li><a href="index.php">HOME</a></li>
<li onmouseover="this.className='nav-on'" onmouseout="this.className=''">SSSS
<ul>
<li><a href="4.php" >AAAA</a></li>
<li><a href="5.php" >BBBB</a></li>
<li><a href="6.php" >VVVV</a></li>
</ul>
</li>
<li onmouseover="this.className='nav-on'" onmouseout="this.className=''">ABOUT
<ul>
<li><a href="1.php" >EEEEE</a></li>
<li><a href="2.php" >RRRRR</a></li>
<li><a href="3.php" >YYYYY</a></li>
</ul>
</li>
</ul>
</div>
<div id="middle"> <p><?php include("news.php") ?> </p></div>
</body>
</html>
news.php代码如下:http://202.122.102.179/KEN/NEWS.TXT
错误的显示如图上部分,我希望做成图下半部分的样子,谢谢! 展开
8个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询