課程
/前端開發(fā)
/HTML/CSS
/導航條菜單的制作
ennnn
2019-12-12
源自:導航條菜單的制作 1-1
正在回答
<!doctype?html> <html> <head> <meta?charset="utf-8"> <title>無標題文檔</title> ?<link?href="圓角邊.css"?type="text/css"?rel="stylesheet"?/> </head> <body>? <ul>? <li?class="on"><a?href="#">首?頁</a></li>? ????????????<li><a?href="#">聯(lián)系我們</a></li> ??????????????<li><a?href="#">新聞快訊</a></li>? ??????????????????<li><a?href="#">產(chǎn)品展示</a></li>? ???????????????????????<li><a?href="#">售后服務</a></li>? ?</ul> ?</body> ?</html> ?/*上面為HTML代碼*/ ?/*下面是css外聯(lián)樣式代碼*/
@charset "utf-8"??*{margin: 0;padding: 0; font-size: 20px}ul{height: 50px;list-style: none;border-bottom: 5px solid #F36708;padding-left: 40px;}li{float: left;margin-top: 20px;}a{display: block;width: 120px;height: 30px;?text-decoration: none;text-align: center;?background:url("../decompression/《導航條菜單制作》課程源代碼/images/btnBg.png");color: black;?background-color: aqua;}.on ,a:hover{background-position: 0 -30px;color: #ED6A6D;}
還可以定義一個盒子把兩寬變圓: 因為超鏈接a是內(nèi)聯(lián)樣式 代碼如下 a{ display:block;/*更改為塊元素*/ ?? width:300px; ?? height:30px; ?? border-radious:30px;/*定義圓邊*/ }
舉報
水平、垂直、圓角導航條菜單,讓您的技術探索之路更高效
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關注慕課網(wǎng)微信公眾號
2019-12-15
@charset "utf-8"
?
?*{margin: 0;padding: 0; font-size: 20px}
ul{height: 50px;list-style: none;border-bottom: 5px solid #F36708;padding-left: 40px;}
li{float: left;margin-top: 20px;}
a{display: block;width: 120px;height: 30px;
?text-decoration: none;text-align: center;
?background:url("../decompression/《導航條菜單制作》課程源代碼/images/btnBg.png");color: black;
?background-color: aqua;}
.on ,a:hover{background-position: 0 -30px;color: #ED6A6D;}
2020-01-05
還可以定義一個盒子把兩寬變圓:
因為超鏈接a是內(nèi)聯(lián)樣式
代碼如下
a{ display:block;/*更改為塊元素*/
?? width:300px;
?? height:30px;
?? border-radious:30px;/*定義圓邊*/
}