Heim  >  Artikel  >  Web-Frontend  >  CSS实现菜单栏制作,鼠标经过变色_html/css_WEB-ITnose

CSS实现菜单栏制作,鼠标经过变色_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:06:281303Durchsuche

CSS样式为:

 <style type="text/css">     #navigation     {     	width:200px;     	font-family:Arial;     	}     #navigation ul     {     	list-style-type:none;                 /* 不显示项目符号*/     	margin:0px;     	padding:0px;     	text-decoration:none;     	}     	     	#navigation li     	{     		 border-bottom:1px solid #ED9F9F;  /* 添加标签<li>的下划线*/     		}     		     	#navigation li a     	{     	 display:block;                       /* 区块显示*/     	 padding:5px 5px 5px 0.5em;     	 text-decoration:none;     	 border-left:12px solid #711515;      /* 左边的粗红边*/     	 border-right:1px solid #711515;      /* 右侧阴影*/     		}     	#navigation li a:link,#navigation li a:visited /* 超链接正常状态、被访问过的状态*/     	{     		 background-color:#c11136;            /* 设置背景色*/     		 color:#FFFFFF;                       /* 设置文字颜色*/      		}     	#navigation li a:hover      /*鼠标经过时*/     	{     		 background-color:#990020;  /* 改变背景色*/     		 color:#ffff00;             /* 改变文字颜色*/     		}    </style>    

HTML前台代码:

    
初始效果:

鼠标经过效果:



Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn