DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> HTML基礎知識 >> HTML5詳解 >> html5 css3網站菜單實現代碼
html5 css3網站菜單實現代碼
編輯:HTML5詳解     

實現的難點在於:first-child,last-child 兩個選擇器,以後margin-left:-1px;的應用,33%,34%寬度的技巧處理。

另外一個難點是:box-shadow:1px 0 0 #F1F1F1 inset; 的實現。

最後是:

復制代碼代碼如下:
background:-webkit-gradIEnt(linear, left top, left bottom, from(#f9f9f9), to(#b6b4b4));background:-moz-linear-gradient(top, #f9f9f9, #b6b4b4);background:-o-linear-gradient(top, #f9f9f9, #b6b4b4);background:linear-gradIEnt(top, #f9f9f9, #b6b4b4); 


復制代碼代碼如下:

<!doctype Html>
<Html XMLns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xHtml</a>" XML:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/Html;charset=UTF-8"/>
<title>Html5,CSS3菜單</title>
<style type="text/CSS">
.jikey_demo{ width:80%; margin:0 auto; background:#f1f1f1;}
.news_info{margin-bottom:5px;border:1px solid #bbb;border-radius:5px;box-shadow:0 1px 0 #f1f1f1;}
.news_info a{display:inline-block;width:33%;height:26px;font-family:"微軟雅黑";line-height:26px;text-align:center;color:#555;border-right:1px solid #ccc;box-shadow:1px 0 0 #F1F1F1 inset;}
.news_info a:first-child{width:33%;box-shadow:none;border-radius:4px 0 0 4px;}
.news_info a:last-child{width:34%;border-right:none;margin-left:-2px;border-radius:0 4px 4px 0;}
.news_info a:hover, .news_info a.current{color:#208edd;background:-webkit-gradIEnt(linear, left top, left bottom, from(#f9f9f9), to(#b6b4b4));background:-moz-linear-gradient(top, #f9f9f9, #b6b4b4);background:-o-linear-gradient(top, #f9f9f9, #b6b4b4);background:linear-gradIEnt(top, #f9f9f9, #b6b4b4);}
</style>
</head>
<body>
<div class="jikey_demo">
<nav class="news_info"><a class="current" href="/news/">新聞1</a><a class="" href="/guide/">新聞2</a><a class="" href="/revIEw/">新聞3</a></nav>
</div>
</body>
</Html>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved