基于CSS实现带阴影和小箭头的黑色风格下拉菜单
建站知识 2021-07-03 08:15www.168986.cn长沙网站建设
本文实例讲述了基于CSS实现带阴影和小箭头的黑色风格下拉菜单效果。分享给大家供大家参考。具体如下
这是一款黑色风格的CSS菜单,带阴影和小箭头效果,纯CSS技术实现的,没有借助任何的JavaScript代码,风格非常流行,相信你看了也会喜欢的。
先来看看运行效果截图
在线演示地址如下
具体代码如下
复制代码
代码如下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://.w3c./TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://.w3./1999/xhtml">
<HEAD>
<TITLE>黑色风格的菜单,我的小站菜单</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<STYLE type="text/css">
#selectedI #mI {
FONT-WEIGHT: bold;
BACKGROUND: url(images/bg.gif) no-repeat -260px -40px;
COLOR: #f33;
margin:0 auto;
}
{
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none; BORDER-RIGHT-WIDTH: 0px
}
BODY {
FONT: 12px Arial, sans-serif; COLOR: #666
}
A {
COLOR: #555; TEXT-DECORATION: none
}
A:hover {
COLOR: #e33; TEXT-DECORATION: underline
}
INPUT {
FONT: 12px verdana, sans-serif; VERTICAL-ALIGN: middle; CURSOR: pointer
}
SELECT {
FONT: 12px verdana, sans-serif; VERTICAL-ALIGN: middle; CURSOR: pointer
}
TEXTAREA {
FONT: 12px verdana, sans-serif; VERTICAL-ALIGN: middle; CURSOR: pointer
}
LABEL {
FONT: 12px verdana, sans-serif; VERTICAL-ALIGN: middle; CURSOR: pointer
}
CITE {
FONT-STYLE: normal
}
EM {
FONT-STYLE: normal
}
I {
FONT-STYLE: normal
}
.clear {
CLEAR: both; OVERFLOW: hidden; HEIGHT: 0px
}
.space {
CLEAR: both; OVERFLOW: hidden; HEIGHT: 0px
}
.line {
CLEAR: both; OVERFLOW: hidden; HEIGHT: 0px
}
.division {
CLEAR: both; OVERFLOW: hidden; HEIGHT: 0px
}
.space {
HEIGHT: 5px
}
.line {
BORDER-BOTTOM: #d9d9d9 1px solid
}
.division {
BORDER-TOP: #aaa 1px solid; BORDER-BOTTOM: #fff 1px solid
}
H2 {
FONT: bold 12px Tahoma, sans-serif; COLOR: #333
}
H3 {
FONT: bold 12px Tahoma, sans-serif; COLOR: #333
}
.ft {
CLEAR: both; BACKGROUND: url(images/bg.gif) no-repeat right -80px; OVERFLOW: hidden; HEIGHT: 4px
}
.fe {
CLEAR: both; BACKGROUND: url(images/bg.gif) no-repeat right -80px; OVERFLOW: hidden; HEIGHT: 4px
}
H2 {
CLEAR: both; BACKGROUND: url(images/bg.gif) no-repeat right -80px; OVERFLOW: hidden; HEIGHT: 4px
}
.fe {
BACKGROUND-POSITION: right -110px; MARGIN-BOTTOM: 10px
}
.ftl {
BACKGROUND: url(images/bg.gif) left -80px; FLOAT: left; OVERFLOW: hidden; WIDTH: 4px; HEIGHT: 4px
}
.fel {
BACKGROUND: url(images/bg.gif) left -80px; FLOAT: left; OVERFLOW: hidden; WIDTH: 4px; HEIGHT: 4px
}
.fel {
BACKGROUND-POSITION: left -110px
}
.fm {
CLEAR: both; BORDER-RIGHT: #d9d9d9 1px solid; PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 6px; OVERFLOW: auto; BORDER-LEFT: #d9d9d9 1px solid; PADDING-TOP: 6px; ZOOM: 1
}
.hNav {
CLEAR: both; PADDING-RIGHT: 2px; PADDING-LEFT: 3px; BACKGROUND: url(images/bg.gif) no-repeat left ; PADDING-BOTTOM: 5px; WIDTH: 891px; PADDING-TOP: 3px; HEIGHT: 29px; margin:0 auto;
}
.hNav UL LI {
FLOAT: left; OVERFLOW: hidden; WIDTH: 99px; LINE-HEIGHT: 29px; HEIGHT: 29px; TEXT-ALIGN: center
}
.hNav UL LI A {
DISPLAY: block; OVERFLOW: hidden; WIDTH: 99px; CURSOR: pointer; COLOR: #fff; WHITE-SPACE: nowrap; HEIGHT: 29px
}
.hNav UL LI A:hover {
BACKGROUND: url(images/bg.gif) no-repeat -260px -40px; COLOR: #f33; TEXT-DECORATION: none
}
.hNav UL LI.over {
BACKGROUND: url(images/bg.gif) no-repeat -260px -40px; OVERFLOW: visible
}
.hNav UL LI.over UL {
Z-INDEX: 2; FILTER: alpha(opacity=80); FLOAT: left; OVERFLOW: auto; POSITION: relative; opacity: 0.8; -moz-opacity: 0.8
}
.hNav UL LI.over UL LI {
BACKGROUND: #111; LINE-HEIGHT: 24px; HEIGHT: 24px
}
.hNav UL LI.over UL LI A {
MARGIN: 0px 3px; WIDTH: 93px; HEIGHT: 24px
}
.hNav UL LI.over UL LI A:hover {
COLOR: #e00
}
.hNav UL LI.over UL LI.e1 {
DISPLAY: inline; MARGIN: 0px 1px; OVERFLOW: hidden; WIDTH: 97px; HEIGHT: 1px
}
.hNav UL LI.over UL LI.e2 {
DISPLAY: inline; MARGIN: 0px 1px; OVERFLOW: hidden; WIDTH: 97px; HEIGHT: 1px
}
.hNav UL LI.over UL LI.e3 {
DISPLAY: inline; MARGIN: 0px 1px; OVERFLOW: hidden; WIDTH: 97px; HEIGHT: 1px
}
.hNav UL LI.over UL LI.e2 {
BACKGROUND: #e30
}
.hNav UL LI.over UL LI.e3 {
BACKGROUND: #e30
}
.hNav UL LI.over UL LI.e3 {
MARGIN: 0px 3px; WIDTH: 93px
}
</STYLE>
<BODY id=selectedI>
<DIV class=hNav>
<UL>
<LI><A id=mI href="#">首页</A> </LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m1 href="javascript://;">网站导航</A>
<UL>
<LI><A id=m2 href="#">财富</A> </LI>
<LI><A href="#" target="_blank">外部链接</A></LI>
<LI><A id=m4 href="#">创业</A> </LI>
<LI><A id=m5 href="#">感情</A> </LI>
<LI><A id=m6 href="#">家庭</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m7 href="javascript://;">影印娱乐</A>
<UL>
<LI><A id=m9 href="#">我的DV</A> </LI>
<LI><A id=m20 href="#">我的相册</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m8 href="javascript://;">新人新事</A>
<UL>
<LI><A id=m10 href="#">天下新闻</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
<UL>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m12 href="javascript://;">个人作品</A>
<UL>
<LI><A id=m19 href="#">心情感想</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m13 href="javascript://;">合作事宜</A>
<UL>
<LI><A id=m18 href="#">项目资金</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m14 href="javascript://;">团队建设</A>
<UL>
<LI><A id=m17 href="#">我是团长</A></LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m15 href="javascript://;">联系方式</A>
<UL>
<LI><A id=m16 href="#">联系方式</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI><A id=mL href="#">留言本</A> </LI>
</UL>
</DIV>
</DIV>
</BODY>
</HTML>
"http://.w3c./TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://.w3./1999/xhtml">
<HEAD>
<TITLE>黑色风格的菜单,我的小站菜单</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<STYLE type="text/css">
#selectedI #mI {
FONT-WEIGHT: bold;
BACKGROUND: url(images/bg.gif) no-repeat -260px -40px;
COLOR: #f33;
margin:0 auto;
}
{
BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none; BORDER-RIGHT-WIDTH: 0px
}
BODY {
FONT: 12px Arial, sans-serif; COLOR: #666
}
A {
COLOR: #555; TEXT-DECORATION: none
}
A:hover {
COLOR: #e33; TEXT-DECORATION: underline
}
INPUT {
FONT: 12px verdana, sans-serif; VERTICAL-ALIGN: middle; CURSOR: pointer
}
SELECT {
FONT: 12px verdana, sans-serif; VERTICAL-ALIGN: middle; CURSOR: pointer
}
TEXTAREA {
FONT: 12px verdana, sans-serif; VERTICAL-ALIGN: middle; CURSOR: pointer
}
LABEL {
FONT: 12px verdana, sans-serif; VERTICAL-ALIGN: middle; CURSOR: pointer
}
CITE {
FONT-STYLE: normal
}
EM {
FONT-STYLE: normal
}
I {
FONT-STYLE: normal
}
.clear {
CLEAR: both; OVERFLOW: hidden; HEIGHT: 0px
}
.space {
CLEAR: both; OVERFLOW: hidden; HEIGHT: 0px
}
.line {
CLEAR: both; OVERFLOW: hidden; HEIGHT: 0px
}
.division {
CLEAR: both; OVERFLOW: hidden; HEIGHT: 0px
}
.space {
HEIGHT: 5px
}
.line {
BORDER-BOTTOM: #d9d9d9 1px solid
}
.division {
BORDER-TOP: #aaa 1px solid; BORDER-BOTTOM: #fff 1px solid
}
H2 {
FONT: bold 12px Tahoma, sans-serif; COLOR: #333
}
H3 {
FONT: bold 12px Tahoma, sans-serif; COLOR: #333
}
.ft {
CLEAR: both; BACKGROUND: url(images/bg.gif) no-repeat right -80px; OVERFLOW: hidden; HEIGHT: 4px
}
.fe {
CLEAR: both; BACKGROUND: url(images/bg.gif) no-repeat right -80px; OVERFLOW: hidden; HEIGHT: 4px
}
H2 {
CLEAR: both; BACKGROUND: url(images/bg.gif) no-repeat right -80px; OVERFLOW: hidden; HEIGHT: 4px
}
.fe {
BACKGROUND-POSITION: right -110px; MARGIN-BOTTOM: 10px
}
.ftl {
BACKGROUND: url(images/bg.gif) left -80px; FLOAT: left; OVERFLOW: hidden; WIDTH: 4px; HEIGHT: 4px
}
.fel {
BACKGROUND: url(images/bg.gif) left -80px; FLOAT: left; OVERFLOW: hidden; WIDTH: 4px; HEIGHT: 4px
}
.fel {
BACKGROUND-POSITION: left -110px
}
.fm {
CLEAR: both; BORDER-RIGHT: #d9d9d9 1px solid; PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 6px; OVERFLOW: auto; BORDER-LEFT: #d9d9d9 1px solid; PADDING-TOP: 6px; ZOOM: 1
}
.hNav {
CLEAR: both; PADDING-RIGHT: 2px; PADDING-LEFT: 3px; BACKGROUND: url(images/bg.gif) no-repeat left ; PADDING-BOTTOM: 5px; WIDTH: 891px; PADDING-TOP: 3px; HEIGHT: 29px; margin:0 auto;
}
.hNav UL LI {
FLOAT: left; OVERFLOW: hidden; WIDTH: 99px; LINE-HEIGHT: 29px; HEIGHT: 29px; TEXT-ALIGN: center
}
.hNav UL LI A {
DISPLAY: block; OVERFLOW: hidden; WIDTH: 99px; CURSOR: pointer; COLOR: #fff; WHITE-SPACE: nowrap; HEIGHT: 29px
}
.hNav UL LI A:hover {
BACKGROUND: url(images/bg.gif) no-repeat -260px -40px; COLOR: #f33; TEXT-DECORATION: none
}
.hNav UL LI.over {
BACKGROUND: url(images/bg.gif) no-repeat -260px -40px; OVERFLOW: visible
}
.hNav UL LI.over UL {
Z-INDEX: 2; FILTER: alpha(opacity=80); FLOAT: left; OVERFLOW: auto; POSITION: relative; opacity: 0.8; -moz-opacity: 0.8
}
.hNav UL LI.over UL LI {
BACKGROUND: #111; LINE-HEIGHT: 24px; HEIGHT: 24px
}
.hNav UL LI.over UL LI A {
MARGIN: 0px 3px; WIDTH: 93px; HEIGHT: 24px
}
.hNav UL LI.over UL LI A:hover {
COLOR: #e00
}
.hNav UL LI.over UL LI.e1 {
DISPLAY: inline; MARGIN: 0px 1px; OVERFLOW: hidden; WIDTH: 97px; HEIGHT: 1px
}
.hNav UL LI.over UL LI.e2 {
DISPLAY: inline; MARGIN: 0px 1px; OVERFLOW: hidden; WIDTH: 97px; HEIGHT: 1px
}
.hNav UL LI.over UL LI.e3 {
DISPLAY: inline; MARGIN: 0px 1px; OVERFLOW: hidden; WIDTH: 97px; HEIGHT: 1px
}
.hNav UL LI.over UL LI.e2 {
BACKGROUND: #e30
}
.hNav UL LI.over UL LI.e3 {
BACKGROUND: #e30
}
.hNav UL LI.over UL LI.e3 {
MARGIN: 0px 3px; WIDTH: 93px
}
</STYLE>
<BODY id=selectedI>
<DIV class=hNav>
<UL>
<LI><A id=mI href="#">首页</A> </LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m1 href="javascript://;">网站导航</A>
<UL>
<LI><A id=m2 href="#">财富</A> </LI>
<LI><A href="#" target="_blank">外部链接</A></LI>
<LI><A id=m4 href="#">创业</A> </LI>
<LI><A id=m5 href="#">感情</A> </LI>
<LI><A id=m6 href="#">家庭</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m7 href="javascript://;">影印娱乐</A>
<UL>
<LI><A id=m9 href="#">我的DV</A> </LI>
<LI><A id=m20 href="#">我的相册</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m8 href="javascript://;">新人新事</A>
<UL>
<LI><A id=m10 href="#">天下新闻</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
<UL>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m12 href="javascript://;">个人作品</A>
<UL>
<LI><A id=m19 href="#">心情感想</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m13 href="javascript://;">合作事宜</A>
<UL>
<LI><A id=m18 href="#">项目资金</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m14 href="javascript://;">团队建设</A>
<UL>
<LI><A id=m17 href="#">我是团长</A></LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI onMouseOver="this.className='over'" onMouseOut="this.className=''"><A id=m15 href="javascript://;">联系方式</A>
<UL>
<LI><A id=m16 href="#">联系方式</A> </LI>
<LI class=e1></LI>
<LI class=e2></LI>
<LI class=e3><!-- 圆角 --></LI>
</UL>
</LI>
<LI><A id=mL href="#">留言本</A> </LI>
</UL>
</DIV>
</DIV>
</BODY>
</HTML>
希望本文所述对大家的css网页设计有所帮助。
长沙网站设计
- 如何自己建一个网站 自己想建个网站,怎么建
- 如何制作网站免费建站 创建网站免费注册
- html简单网页代码 html简单网页代码超链接
- dreamweaver网页制作 dreamweaver网页制作模板
- 上海网站建设 上海网站建设制作微信
- 如何制作网站和网页 如何制作一个网页
- html网页制作代码大全 端午节html网页制作代码大
- app开发公司 app开发公司前十名
- html网页制作 html网页制作文字居中
- app制作一个需要多少钱 请人制作一个app多少钱
- 成都网站制作 成都网站制作维护
- 百度建一个网站多少钱 百度做个公司网站要多少
- html+css网页制作成品 web网页制作成品css+javascrip
- html网页制作案例 html网页设计案例
- html+css网页制作成品 web网页制作成品css+javascrip
- 个人网站模板 个人网站模板HTML