导航条练习
作者:互联网
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> </head> <style> ul { width: 1200pxpx; height: 48px; background-color: #777777; list-style: none; } li { float: left; /* margin-right: 50px; */ line-height: 48px; } ul a { /* 将a标签转换成块元素 */ display: block; /* 去掉下换线 */ text-decoration: none; /* 设置字体颜色 */ color: #000000; /* 设置字体大小 */ font-size: 18px; /* 设置每个词之间的间距 */ padding: 0 39px; } ul a:hover { background-color: aqua; } </style> <body> <ul> <li><a href="#">张飞</a></li> <li><a href="#">关羽</a></li> <li><a href="#">刘备</a></li> <li><a href="#">马超</a></li> <li><a href="#">赵云</a></li> <li><a href="#">黄忠</a></li> </ul> </body> </html>
标签:none,ul,color,练习,height,48px,background,导航条 来源: https://www.cnblogs.com/0722tian/p/16054642.html