你两个层的位置对换一下不就可以了吗?<div id="nav_menu">
<a href="index.aspx">首页</a> <a href="essay.aspx">随笔</a> <a href="article.aspx">论文</a>
<a href="works.aspx">工作</a> <a href="course.aspx">课程</a> <a href="Photo.aspx">照片</a>
<a href="about.aspx">关于</a> <a href="contact.aspx">联系</a>
</div>
<div id="top">
<div id="top_left"></div>
<div id="top_title"></div>
<div id="top_right"></div>
</div>
<a href="index.aspx">首页</a> <a href="essay.aspx">随笔</a> <a href="article.aspx">论文</a>
<a href="works.aspx">工作</a> <a href="course.aspx">课程</a> <a href="Photo.aspx">照片</a>
<a href="about.aspx">关于</a> <a href="contact.aspx">联系</a>
</div>
<div id="top">
<div id="top_left"></div>
<div id="top_title"></div>
<div id="top_right"></div>
</div>
解决方案 »
- 求一款开源!免费。的web前端UI框架。最好是基于jquery的
- JS如何实现全屏?
- 用Javascript进行计算,屏幕僵住,有办法解决吗?
- javascript如何判断AJAX返回到DIV中的值
- 有什么办法能够拿到上传各个文件的大小?
- 如何用JS在多行文本框中光标入插入文字?要求FIREFOX也能正常用
- 如何用java脚本制作图片垂直翻转...
- 高手看看:如果不是每次都是从数据库中取数据,如何实现以下的功能呢?实现不行的话只能每次取数据库拉:(
- 问一下,可不可以只用javascript和html实现页面间信息的传递
- 如何用iframe实现jsp页面内嵌
- js最新的版本到哪里下载
- 关于JS快速显示提示信息特效中的问题
<div id="top">
<div id="top_left"></div>
<div id="top_title"></div>
<div id="top_right"></div>
<div id="nav_menu">
<a href="index.aspx">首页</a> <a href="essay.aspx">随笔</a> <a href="article.aspx">论文</a>
<a href="works.aspx">工作</a> <a href="course.aspx">课程</a> <a href="Photo.aspx">照片</a>
<a href="about.aspx">关于</a> <a href="contact.aspx">联系</a>
</div>
</div>
<div id="top">
<div id="top_left"></div>
<div id="top_title" style="z-index:100"></div>
<div id="top_right"></div>
<div id="nav_menu" style="z-index:999">
<a href="index.aspx">首页</a> <a href="essay.aspx">随笔</a> <a href="article.aspx">论文</a>
<a href="works.aspx">工作</a> <a href="course.aspx">课程</a> <a href="Photo.aspx">照片</a>
<a href="about.aspx">关于</a> <a href="contact.aspx">联系</a>
</div>
</div>就是在覆盖的层上加上: style="z-index:100" 和 style="z-index:999"也不行,不知是何原因?
#top
{
background-color:red;
width:100%;
height:79px;
overflow:hidden;
text-align: center;
margin-right: auto;
margin-left: auto;
position:absolute;
top:10px;
left:10px;}
#top_left
{
background-color:blue;
float:left;
width:18px;
height:79px;
overflow:hidden;
}
#top_title
{
background-color:green;
float:left;
width:214px;
height:79px;
overflow:hidden;
}
#top_right
{
background-image: url("../images/t_right.jpg");
float:right;
width:18px;
height:79px;
overflow:hidden;
}
#nav_menu
{
font-size: 14px;
font-weight:bold;
width:100%;
height:30px;
margin-top: 15px;
padding-top:8px;
background-color: #F2F2F2;
overflow:hidden;
text-align: right;
margin-right: auto;
margin-left: auto;
z-index:999;
position:absolute;
top:-10px;
left:10px;
}
#nav_menu a{margin-right:10px;text-decoration: none;}
</style>
<div id="top">
<div id="top_left"></div>
<div id="top_title"></div>
<div id="top_right"></div>
</div><div id="nav_menu">
<a href="index.aspx">首页</a> <a href="essay.aspx">随笔</a> <a href="article.aspx">论文</a>
<a href="works.aspx">工作</a> <a href="course.aspx">课程</a> <a href="Photo.aspx">照片</a>
<a href="about.aspx">关于</a> <a href="contact.aspx">联系</a>
</div>
现在效果:http://www.kacan.com.cn/test/test.aspx我要的效果:菜单连接文字要放在下面的蓝色背景上。
现在效果:http://www.kacan.com.cn/test/test.aspx我要的效果:菜单连接文字要放在下面的蓝色背景上
看看是不是你要的效果把某东西放在div标签/容器上方,一般要将另一个div设置样式的 position 为 absolute,作为一个浮动的div,也就称为层。
之后再定位该层的位置。若要适应任何分辨率,最好是将该层放在你要放某标签/容器上方的里面,这样绝对定位比较好,一般只定位两个位置,例如 margin/padding top right,或 left bottom当然还有很多方式,取决于你自己的需求。
不知道这样会不会理解错你的意思。有什么问题加QQ群:8648134=========代码<style by tesion.>
#top
{
background-image: url("../images/t_bg.jpg");
width:100%;
height:79px;
overflow:hidden;
text-align: center;
margin-right: auto;
margin-left: auto;}
#top_left
{
background-image: url("../images/t_left.jpg");
float:left;
width:18px;
height:79px;
overflow:hidden;
}
#top_title
{
background-image: url("../images/t_title.jpg");
float:left;
width:214px;
height:79px;
overflow:hidden;
}
#top_right
{
background-image: url("../images/t_right.jpg");
float:right;
width:18px;
height:79px;
overflow:hidden;
}
#nav_menu
{
font-size: 14px;
font-weight:bold;
height:30px;
margin-top: 15px;
padding-top:8px;
overflow:hidden;
text-align: right;
margin-right: auto;
margin-left: auto;
/* 层 */position: absolute;
/* here by tesion design.URL: http://www.netjoin.net */
}
#nav_menu a{margin-right:10px;text-decoration: none;}</style><div id="top">
<div id="nav_menu">
<a href="index.aspx">Ê×Ò³</a> <a href="essay.aspx">Ëæ±Ê</a> <a href="article.aspx">ÂÛÎÄ</a>
<a href="works.aspx">¹¤×÷</a> <a href="course.aspx">¿Î³Ì</a> <a href="Photo.aspx">ÕÕƬ</a>
<a href="about.aspx">¹ØÓÚ</a> <a href="contact.aspx">ÁªÏµ</a>
</div>
<div id="top_left"></div>
<div id="top_title"></div>
<div id="top_right"></div>
</div>