CSS3让我们花更少的时间做更多的事,其强大让人叹止。windows7系统界面很华丽,现在看看我们用CSS3和一些ICON实现windows7的开始菜单。查看Demo

Container
staremenu包含两个无序的菜单链接,其中用到CSS3中的圆角,阴影,渐变!样式代码如下:
- #startmenu {
- border:solid 1px #838A44;
- overflow:visible;
- display:inline-block;
- margin:60px 0 0 20px;
- -moz-border-radius:5px;
- -webkit-border-radius:5px;
- position:relative;
- -moz-box-shadow: inset 0 0 1px #fff;
- -webkit-box-shadow: inset 0 0 1px #fff;
- background-color:#A5AF4C;
- background: -moz-linear-gradient(top, #E8EC4D, #869F03 50%, #697806);
- background: -webkit-gradient(linear, center top, center bottom, from(#E8EC4D),color-stop(45%, #869F03), to(#697806));
- }
Programs menu
program中用到CSS3中的圆角,阴影,渐变!样式代码如下:
- #programs {
- background:#fff;
- border:solid 1px #838A44;
- margin:7px 0 7px 7px;
- -moz-box-shadow: 0 0 1px #fff;
- -webkit-box-shadow: 0 0 1px #fff;
- -moz-border-radius:3px;
- -webkit-border-radius:3px;
- min-height:400px;
- }
- #programs a {
- border:solid 1px transparent;
- display:block;
- padding:3px;
- margin:3px;
- color:#4b4b4b;
- text-decoration:none;
- min-width:220px;
- }
- #programs a:hover {
- border:solid 1px #DDDE46;
- -moz-border-radius:5px;
- -webkit-border-radius:5px;
- -moz-box-shadow: inset 0 0 1px #fff;
- -webkit-box-shadow: inset 0 0 1px #fff;
- background-color:#cfe3fd;
- background: -moz-linear-gradient(top, #E5E64B, #B4C940);
- background: -webkit-gradient(linear, center top, center bottom, from(#E5E64B), to(#B4C940));}
- }
- #programs a img {
- border:0;
- vertical-align:middle;
- margin:0 5px 0 0;
- }
Links menu
Link menu比较简单,其中用到CSS3中的圆角,阴影,渐变!样式代码如下:
- #links li.icon {
- text-align:center;
- }
- #links a {
- border:solid 1px transparent;
- display:block;
- margin:5px 0;
- position:relative;
- color:#fff;
- text-decoration:none;
- min-width:120px;
- }
- #links a:hover {
- border:solid 1px #F2FF7F;
- -moz-border-radius:5px;
- -webkit-border-radius:5px;
- -moz-box-shadow: inset 0 0 1px #fff;
- -webkit-box-shadow: inset 0 0 1px #fff;
- background-color:#658da0;
- background: -moz-linear-gradient(center left, #CAD184, #747C2F 50%, #889044);
- background: -webkit-gradient(linear, 0% 100%, 100% 100%, from(#CAD184), color-stop(50%, #747C2F), to(#889044));
- }
- #links a span {
- padding:5px;
- display:block;
- }
- #links a:hover span {
- -moz-border-radius:5px;
- -webkit-border-radius:5px;
- background: -moz-linear-gradient(center top, transparent, transparent 49%, #6D7721 50%, #8E9542);
- background: -webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(49%, transparent),
color-stop(50%, #6D7721), to(#8E9542)); - }

要点学习:
阴影
box-shadow:<length> <llength> <llength> <llength> || <lcolor>
-moz-box-shadow: inset 0 0 1px #fff;
-webkit-box-shadow: inset 0 0 1px #fff;
圆角
border-radius : none | <length>{1,4} [ / <length>{1,4} ]?
-moz-border-radius:5px;
-webkit-border-radius:5px;
背景渐变
-moz-linear-gradient( [<point> || <angle>,]? <stop>, <stop> [, <stop>]* )
-webkit-gradient(<type>, <point> [, <radius>]?, <point> [, <radius>]? [, <stop>]*)
background: -moz-linear-gradient(center top, transparent, transparent 49%, #6D7721 50%, #8E9542);
background: -webkit-gradient(linear, center top, center bottom, from(transparent), color-stop(49%, transparent),
color-stop(50%, #6D7721), to(#8E9542));