用html+css哦导航栏,我的导航栏的的div跑到最顶部去了,怎么修改 html和css的代码都在下面

问题描述

<!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><link href="test.css" rel="stylesheet" type="text/css" />  </head> <body><div class="contariner" > <div class="bor_1" ><div class="bor_1_left"></div><div class="bor_1_center"></div><div class="bor_1_right">     <ul><li><a href="#">登陆</a></li><li>&nbsp;&nbsp;&nbsp;</li><li><a href="#" >注册</a></li><li>&nbsp;&nbsp;&nbsp;</li> </ul></div></div>  <div class="top_1"><div class="top_1_left"><ul><li class="STYLE1"><a href="#" >首页</a></li><li class="STYLE1"><a href="#">相册</a></li><li class="STYLE1"><a href="#">日志</a></li><li class="STYLE1"><a href="#">个人信息</a></li><li class="STYLE1"><a href="#">iteye</a></li></ul></div>   <div id="top_right"> <ul><li class="STYLE1"><a href="#" >个人中心</a></li><li class="STYLE1"><a href="#">百度知道</a></li></ul></div>   </div>  </body></html>   .contariner {height: 800px;width: 1340px;}.STYLE1 {font-size: 16px;font-weight: bold;} .contariner .bor_1 {background-color:#FFFFFF;height: 60px;width: 1240px;border: thin dashed #CCCCCC;font-style: normal;float:right;  }.contariner .bor_1_left{background-color:#999;height:58px;width:800px;float:left; } .contariner .bor_1_center{background:#330033;    height:58px;width:150px;float:left;} .contariner .bor_1_right{background-color:#00FF00;height:58px;width:288px;float:right;}  .contariner .bor_1 .bor_1_right li {background-position: top;float: right;list-style-type: none;margin: 0px;padding: 1px;}   .contariner .top_1 #top_right {background-color: #00CC00;margin-left:900px;height: 30px;width: 220px;margin-top:-48px;} .contariner .top_1 #top_right ul li {background-color: #00CC00;list-style-type: none;line-height: 30px;width:110px;float: right;text-align: center;margin-bottom: 1p} .contariner .top_1 {margin-top:65px;background-color: #00FF00;height: 30px;width: 1340px;border: 1px dashed #FFFFFF;list-style-type: none; }   .contariner .top_1 .top_1_left {background-color: #00CC00;height: 30px;width: 600px;margin-left:100px;margin-top:-15px; } .contariner .top_1 .top_1_left ul li{background-color: #00CC00;list-style-type: none;line-height: 30px;width:110px;float: left;text-align: center;margin-bottom: 1px;} .contariner .top_1 .top_1_left ul li a{   font-size: 22px;color: #000;text-decoration: none;display:block; } .contariner .top_1 .top_1_left ul li a:hover{background-color:#006699; }

解决方案

<!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 href="test.css" rel="stylesheet" type="text/css" /></head><body><div class="contariner"><!-- --><div class="bor_1"><div class="bor_1_left"></div><div class="bor_1_center"></div><div class="bor_1_right"><ul><li><a href="#">登陆</a></li><li>&nbsp;&nbsp;&nbsp;</li><li><a href="#">注册</a></li><li>&nbsp;&nbsp;&nbsp;</li></ul></div></div><!-- --><div class="top_1"><div class="top_1_left"><ul><li class="STYLE1"><a href="#">首页</a></li><li class="STYLE1"><a href="#">相册</a></li><li class="STYLE1"><a href="#">日志</a></li><li class="STYLE1"><a href="#">个人信息</a></li><li class="STYLE1"><a href="#">iteye</a></li></ul></div><div id="top_right"><ul><li class="STYLE1"><a href="#">个人中心</a></li><li class="STYLE1"><a href="#">百度知道</a></li></ul></div></div></div></body></html><style>.contariner {height: 800px;width: 100%;}.STYLE1 {font-size: 16px;font-weight: bold;}.contariner .bor_1 {background-color: #FFFFFF;height: 60px;width: 100%;border: thin dashed #CCCCCC;font-style: normal;float: left;}.contariner .bor_1_left {background-color: #999;height: 58px;width: 800px;float: left;}.contariner .bor_1_center {background: #330033;height: 58px;width: 150px;float: left;}.contariner .bor_1_right {background-color: #00FF00;height: 58px;width: 288px;float: right;}.contariner .bor_1 .bor_1_right li {background-position: top;float: right;list-style-type: none;margin: 0px;padding: 1px;}.contariner .top_1 #top_right {background-color: #00CC00;margin-left: 900px;height: 30px;width: 220px;margin-top: -48px;}.contariner .top_1 #top_right ul li {background-color: #00CC00;list-style-type: none;line-height: 30px;width: 110px;float: right;text-align: center;margin-bottom: 1p}.contariner .top_1 {background-color: #00FF00;height: 30px;width: 100%;float: left;border: 1px dashed #FFFFFF;list-style-type: none;}.contariner .top_1 .top_1_left {background-color: #00CC00;height: 30px;width: 600px;margin-left: 100px;margin-top: -15px;}.contariner .top_1 .top_1_left ul li {background-color: #00CC00;list-style-type: none;line-height: 30px;width: 110px;float: left;text-align: center;margin-bottom: 1px;}.contariner .top_1 .top_1_left ul li a {font-size: 22px;color: #000;text-decoration: none;display: block;}.contariner .top_1 .top_1_left ul li a:hover {background-color: #006699;}</style>
解决方案二:
html+css 尽量用dreamweaver来画吧 谁用谁知道

时间: 2024-07-31 10:49:15

用html+css哦导航栏,我的导航栏的的div跑到最顶部去了,怎么修改 html和css的代码都在下面的相关文章

Fullpage.js固定导航栏-实现定位导航栏_javascript技巧

FullPage.js 是一个简单而易于使用的插件,用来创建全屏滚动网站(也被称为单页网站).除了可以创建全屏滚动效果以外,也可以给网站添加一些水平的滑块效果.能够自适应不同的屏幕尺寸,包括平板电脑和移动设备. 开始制作自己的个人简历啦,决定要使用固定导航栏,又打算使用fullpage.js做全屏滚动. 仔细看了fullpage文档之后,发现不用额外写js代码就可以实现以下效果: 1.当滚动翻页时,导航栏也自动定位到这一页的标签 2.当然点击标签时,也是滚动到那一页而不是直接跳转的. 一.准备工

纯css实现蓝色圆角效果水平导航菜单代码

         本文实例讲述了纯css实现蓝色圆角效果水平导航菜单代码.分享给大家供大家参考.具体如下:          这是一款可爱的蓝色圆角水平导航菜单,用到几张背景图片,我觉得这款菜单挺实用,特别是用在个人博客中非常合适.在兼容性方面做的也很好,几乎兼容所有的浏览器. 运行效果截图如下: 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org

div+css实现软件公司网站蓝色导航菜单代码

 本文实例讲述了div+css实现软件公司网站蓝色导航菜单代码.分享给大家供大家参考.具体如下: 这是一款基于div+css实现的软件公司网站蓝色导航菜单,非常大气的菜单,鼠标移过菜单的时候,菜单的背景就变化了,觉得挺实用,也比较好看的菜单,除了软件公司可使用,企业一类的站都可以用. 运行效果截图如下: 具体代码如下:   复制代码 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "

ios-iOS隐藏系统导航栏用自定义导航栏

问题描述 iOS隐藏系统导航栏用自定义导航栏 前提:1.navigationBarHidden = YES; 2.不要在每个ViewController中addSubView一次,继承父类的方法也不行. 就是想做一个绝对灵活的导航栏,高度不是44,样式也不是只有左右中三个部分.我听一个大神说这是iOS常识,让我查百度,可是我真的查不到,求助啊. 解决方案 iOS系统导航栏的自定义化 解决方案二: 给一个你想要视图作为导航栏不就行了? 解决方案三: 你自定义一个导航栏 隐藏系统的 再添加到UINa

jQuery+css实现的蓝色水平二级导航菜单效果代码_jquery

本文实例讲述了jQuery+css实现的蓝色水平二级导航菜单效果.分享给大家供大家参考.具体如下: 这是一款蓝色经典的jQuery+CSS实现水平二级导航菜单,相信你会喜欢的,蓝色,超级经典的一种风格,从其它网站上扣下来的,我认为很不错,赶紧分享给大家吧. 运行效果截图如下: 在线演示地址如下: http://demo.jb51.net/js/2015/js-css-blue-line-2level-nav-menu-codes/ 具体代码如下: <!DOCTYPE html PUBLIC &quo

Css实现左栏固定宽度,右栏自适应宽度实例

例  代码如下 复制代码     <!doctype html>     <html lang="zh-CN">     <head>             <meta charset="UTF-8">             <title>左栏固定宽度,右栏自适应之绝对定位法</title>             <style type="text/css">

网页导航设计:网页页面导航设计原则

文章描述:设计师的创意是无限的,但是用户的导航需求是固定的,任何样式,只要能够符合导航原则的几点要求,就可以完成用户的导航任务.更加简便的方法就是只要能在页面元素中找到这个页面的页面路径,就相当于满足了导航原则.这样的原则和方法既可以用来检验我们的设计是否达标 著名的格林童话故事里面汉赛尔和格莱特知道后母想要在深林里面丢掉他们的计划,将面包屑撒在来时的路上,虽然当月亮升起时,面包屑被鸟吃掉了,但是现在的互联网设计师们从这个故事中找到了灵感,设计出不会被鸟吃掉的固定"面包屑". 图1:互

Win8任务栏跑到屏幕顶部如何将其还原到底部

  微软windows操作系统中默认任务栏都是在屏幕底部,相信很多用户也比较习惯这样的操作方式,比如win7 64位旗舰版.但由于某些原因导致任务栏跑到屏幕顶部.左侧或右侧中,这给很多用户操作带来很大的障碍,其实我们可以自定义设置屏幕上的任务栏显示位置即可,对于刚接触到的win8系统用户对这方面的设置也会有些生疏,下面来看看win8任务栏还原到屏幕底部的设置方法. 具体的操作步骤: 1.鼠标右键点击就会出现以的下界面,选择里面的"个性化"并点击进去. 2.在窗口左下方找到"任

Bootstrap入门书籍之(五)导航条、分页导航_javascript技巧

导航条 导航条(navbar)和上一节介绍的Bootstrap入门书籍之(四)菜单.按钮及导航.导航(nav),就相差一个字,多了一个"条"字.其实在Bootstrap框架中他们还是明显的区别.在导航条(navbar)中有一个背景色.而且导航条可以是纯链接(类似导航),也可以是表单,还有就是表单和导航一起结合等多种形式.它们在移动设备上可以折叠(并且可开可关),且在视口(viewport)宽度增加时逐渐变为水平展开模式. 基础导航条 实际上,导航条和导航在外观上的差别并不是那么的大,但