<!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=gb2312" />
<title>测试</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.a{
width: 100%; /*背景宽度*/
height: 1000px; /*背景高度*/
/*background: #BFBFBF;*/ /*背景颜色*/
}
.b{
width: 100%; /*本体宽度*/
height: 50px; /*本体高度*/
background: #4A727F; /*本体颜色*/
position:fixed;
left:1px; /*离左侧距离*/
top:1px; /*离顶部距离*/
z-index:100;
}
</style>
</head><body>
<div class="b"></div>
<div class="a"></div>
</body>
</html>
HTML 固定导航 实例
最新推荐文章于 2024-06-15 12:12:02 发布