荟萃馆

位置:首页 > 设计 > 网页设计

DIV+CSS实现的绿色水平一级菜单代码

本文实例讲述了p+CSS实现的绿色水平一级菜单代码。分享给大家供大家参考。

DIV+CSS实现的绿色水平一级菜单代码

这是一款基于p+CSS实现的绿色水平网站菜单,相信是你喜欢的一种CSS菜单,绿色风格,用到了几张背景图片,大家顺着路径把图片下载下来吧。这款菜单整体感觉效果不错,兼容性又好,不管是用在你的.网站或是学习研究CSS,都是不错的选择。

  运行效果截图如下:

918.jpg

代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"">

<html xmlns="">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>绿色水平CSS菜单</title>

<style>

body{font-size:12px;font-family:Arial,Helvetica,'宋体',sans-serif;color:#333;background:#fff;margin:0;}

a:link{color:#0041D9;text-decoration:none;outline:none;}

a:visited{color:#0041D9;text-decoration:none;outline:none;}

a:hover{color:#f60;text-decoration:underline;outline:none;}

a:active{color:#0041D9;text-decoration:none;outline:none;}

#header{position:relative;width:100%;}

p.bar{position:relative;height:42px;background:url(images/mainmenu.bg14_6x42.gif) repeat-x;}

#header ar{width:900px;}

#header ar {left:266px;position:absolute;top:41px;font-size:14px;font-weight:bold;}

#header ar a{float:left;width:80px;height:24px;line-height:24px;padding-top:7px;text-align:center;color:#000;font-weight:lighter;font-size:14px;background:transparent;}

#header ar a:hover{background:#fff url(images/nav_hover_80x31.gif) no-repeat;text-decoration:none;margin-left:-1px;padding-left:1px;}

#header ar ved{background:#fff url(images/nav_80x31.gif) no-repeat;font-weight:bold;color:#fff;margin-left:-1px;padding-left:1px;}

#header ar ved:hover{background:#fff url(images/nav_80x31.gif) no-repeat;font-weight:bold;color:#fff;text-decoration:underline;}

#header ar {position:absolute;left:266px;top:41px;width:560px;height:31px;z-index:-1;}

#header ar {float:left;width:80px;height:31px;background:transparent url(images/navleft2_80x31.gif) no-repeat;}

#header ar {float:left;width:80px;height:31px;background:transparent url(images/navlcenter_80x31.gif) no-repeat;}