嵌套和背景宽度设置问题

zzq2980 2014-08-18 04:45:53
这个网页前面代码不是我写的, 现在让我修改, 把开头部分的宽度改为100%, 由于是用<tr><td><tabble>写的 我一点头绪都没有,求大神帮忙看看!!!!!


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" href="css/style.css" />
<style type="text/css">
body table tr td table tr td {
font-size: 12px;
color: #FFF;
}


.f12_2
{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 20px;
color: #fdfdfd;
}

a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}

#zyzx{
background: url(../imges/%E9%A6%96%E9%A1%B5/top2-8.jpg) no-repeat;
width:150px;
height:24px;
}
.zy_1{
font-family:Verdana, Geneva, sans-serif;
font-weight:900;
color:#333;
font-size:14px
}
#pt_img{
width:1280px;
height:200px;
margin:0 auto;
}
.zd{width:1280px;
height:950px;
margin:0 auto;
background:#DBE7F3;
border:1px solid #DBE7F3;
position:relative;
}
.zd_center{
width:907px;
height:900px;
margin:0 auto;
background:#FFF;
position:relative;
margin-top:0;
}

.wenzi{
position:absolute;
font-size:10px;
font-family:Verdana, Geneva, sans-serif;
color:#346491;
}
.wenzi_1{
width:750px;
height:350px;
margin:0 auto;
line-height:25px;
font-size:12px;
font-family:Verdana, Geneva, sans-serif;
border:1px solid #F00;
position:relative;
}
.zd_1{width:1280px;
height:600px;
margin:0 auto;
background:#DBE7F3;
border:1px solid #DBE7F3;
position:relative;
}
.zd_center_1{
width:907px;
height:550px;
margin:0 auto;
background:#FFF;
position:relative;
margin-top:0;
}

</style>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
</head>

<body>
<div>
<table width="1280" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="1280" height="24" background="../imges/首页/top1.jpg"><table width="1280" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td width="83">设置主页</td>
<td width="83">添加收藏</td>
<td width="100"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="1279" height="60"><img src="../imges/首页/top2.jpg" width="1280" height="60" /></td>
</tr>
<tr>
<td><table width="1280" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../imges/首页/top2-1.jpg" width="189" height="24" /></td>
<td width="152" align="center" valign="bottom"><a href="index.html"><img src="../imges/首页/top2-2.jpg" width="152" height="24" border=0 /></a></td>
<td><img src="../imges/首页/top2-3.jpg" width="151" height="24" border=0 /></td>
<td width="150" align="center" valign="bottom"><a href="cgal.html"><img src="../imges/首页/top2-4.jpg" width="150" height="24" border=0 /></a></td>
<td><a href="ptzd.html"><img src="../imges/首页/top2-5.jpg" width="149" height="24" border=0 /></a></td>
<td id="zyzx" align="center"><a href="zyzx.html"><font class="zy_1">资源中心</font></a></td>
<td><img src="../imges/首页/top2-6.jpg" width="146" height="24" border=0 /></td>
<td><a href="us.html"><img src="../imges/首页/top2-7.jpg" width="154" height="24" border=0 /></a></td>
<td><img src="../imges/首页/top2_9.png" width="39" height="24" border="0"/></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="../imges/首页/top3.jpg" width="1280" height="11" /></td>
</tr></table></div>
<div id="pt_img"><img src="../imges/平台终端/bd.jpg" width="1280" height="200" /></div>
<tr></tr>
</div>

...全文
181 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzq2980 2014-08-20
  • 打赏
  • 举报
回复
引用 3 楼 dcxy0 的回复:

<!DOCTYPE HTML>
<head>
<title>无标题文档</title>
<meta charset="GB2312">
<style type="text/css">
   
   .f12_2
{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 20px;
color: #fdfdfd;
}

a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}

#indexMenu{
	height:23px;
	margin-top: 50px;
	background-color: #F4F4F4;
}

#indexMenu ul{
	list-style-type: none;
	width: 900px;
	text-align: center;
	padding: 0;
	margin: auto;
}

#indexMenu ul li{
	width:100px;
	float:left;
	text-align: center;
}

#indexMenu ul li:hover{
	color:#FFF;
	background-color: red;
}


</style>
</head>

<body>
<nav id="indexMenu">
	<ul>
		<li><a href="">首页</a></li>
		<li><a href="">测试菜单1</a></li>
		<li><a href="">测试菜单2</a></li>
		<li><a href="">测试菜单3</a></li>
		<li><a href="">测试菜单4</a></li>
		<li><a href="">测试菜单5</a></li>
		<li><a href="">测试菜单6</a></li>
		<li><a href="">测试菜单7</a></li>
		<li><a href="">测试菜单8</a></li>	
	</ul>

</nav>
</body>
</html>
chrome上测试没问题.
虽然没用到 还是谢谢了!
JPF1024 2014-08-19
  • 打赏
  • 举报
回复

<!DOCTYPE HTML>
<head>
<title>无标题文档</title>
<meta charset="GB2312">
<style type="text/css">
   
   .f12_2
{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 20px;
color: #fdfdfd;
}

a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}

#indexMenu{
	height:23px;
	margin-top: 50px;
	background-color: #F4F4F4;
}

#indexMenu ul{
	list-style-type: none;
	width: 900px;
	text-align: center;
	padding: 0;
	margin: auto;
}

#indexMenu ul li{
	width:100px;
	float:left;
	text-align: center;
}

#indexMenu ul li:hover{
	color:#FFF;
	background-color: red;
}


</style>
</head>

<body>
<nav id="indexMenu">
	<ul>
		<li><a href="">首页</a></li>
		<li><a href="">测试菜单1</a></li>
		<li><a href="">测试菜单2</a></li>
		<li><a href="">测试菜单3</a></li>
		<li><a href="">测试菜单4</a></li>
		<li><a href="">测试菜单5</a></li>
		<li><a href="">测试菜单6</a></li>
		<li><a href="">测试菜单7</a></li>
		<li><a href="">测试菜单8</a></li>	
	</ul>

</nav>
</body>
</html>
chrome上测试没问题.
Null_Reference 2014-08-18
  • 打赏
  • 举报
回复
所有的宽度改成百分比就行了。
zzq2980 2014-08-18
  • 打赏
  • 举报
回复



这是图片 我知道有点麻烦 谢谢了

61,114

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧