专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > HTML/CSS

横向导航有关问题

发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
横向导航问题
下面是我刚自己写的一个导航
HTML code
<link rel="stylesheet" type="text/css" href="导航.css" /></head><body><div id="header"><h1><a href="http://www.xnxyw.net"><b>湘南在线</b>www.xnxyw.net</a></h1><div id="menu"><h2><a href="#">首页</a></h2><h2><a href="http://www.xnu.edu.cn">学院首页</a></h2><h2><a href="http://www.xnxyw.net">贴吧</a></h2></div></div></body></html>

CSS code
#header{width:960px;margin-top:80px;margin-left:auto;margin-right:auto;background-color:#00CEDE;height:40px;}h1{width:600px;float:left;font-size:9px;}#header a{color:#666;margin-top:5px;margin-left:10px;text-decoration:none;float:left;}#header a:hover{text-decoration:underline;}b{font-weight:bolder;font-size:16px;}#menu{width:360px;float:right;}#menu h2{width:120px;text-align:center;font-size:16px;}#menu a{width:119px;color:#666;display:block;float:left;text-decoration:none;}#menu a:hover{background-color:#E0FFFF;text-decoration:none;}

我已经设置了<a>的 display属性为block,但是为什么不是横向排列呢?

------解决方案--------------------
h2{float:left;}
------解决方案--------------------
怎么不用ul li呢。这个方便多咯额
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: