這篇文章主要為大家介紹了利用CSS的span標簽來實現,其實看了代碼你會覺得,原來實現雙語菜單如此簡單,需要的朋友可以參考下
主要是用CSS的span標簽來實現,其實看了代碼你會覺得,原來實現雙語菜單如此簡單。
CSS Code復制內容到剪貼板
- <!DOCTYPE Html PUBLIC"-//W3C//DTD XHtml 1.0 Transitional//EN""http://www.jb51.Net/TR/xhtml1/DTD/xHtml1-transitional.dtd">
- <Html XMLns="http://www.jb51.Net/1999/xHtml">
- <head>
- <title>CSS實現的中英文雙語菜單</title>
- <style type="text/CSS">
- ul {
- list-style-type: none;
- }
- li {
- float: left;
- display: block;
- width: 100px;
- }
- a {
- font-size: 9pt;
- font-weight: bold;
- color: #006699;
- text-decoration: none;
- line-height: 12px;
- width: 100px;
- display: block;
- vertical-align: middle;
- }
- a:hover {
- line-height: 12px;
- color: #FF9900;
- text-decoration: none;
- }
- #enFont{
- font-size: 10px;
- color: #999999;
- width: 100px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- line-height: 10px;
- float:left;
- }
- span{margin:0px;padding:0px;}
- </style>
- </head>
- <body>
- <ul>
- <li><a href="/">網站主頁</a><span id="enFont">HOME</span></li>
- <li><a href="/">最新更新</a><span id="enFont">NEW</span></li>
- <li><a href="/">下載排行</a><span id="enFont">TOP</span></li>
- <li><a href="/">網站服務</a><span id="enFont">SERVICE</span></li>
- <li><a href="/">用戶留言</a><span id="enFont">GUESTBOOK</span></li>
- <li><a href="/">聯系我們</a><span id="enFont">CONTACT</span></li>
- </ul>
- </body>
- </Html>