Css常用操作——————导航栏
2016-05-13 22:21
316 查看
一、垂直导航栏
ul{ list-style-type: none; margin: 0px; padding: 0px; } a:link,a:visited{ text-decoration: none; display: block; background-color: aqua; color: black; width: 50px; text-align: center; } a:active,a:hover{ background-color: crimson; }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>导航栏</title> <link href="style.css" type="text/css" rel="stylesheet"> </head> <body> <ul> <li><a href="#">导航1</a></li> <li><a href="#">导航2</a></li> <li><a href="#">导航3</a></li> <li><a href="#">导航4</a></li> </ul> </body> </html>二、水平导航栏
ul{ list-style-type: none; margin: 0px; padding: 0px; background-color: aqua; width: 250px; text-align: center; } a:link,a:visited{ font-weight: bold; text-decoration: none; background-color: aqua; color: black; width: 50px; text-align: center; } a:active,a:hover{ background-color: crimson; } li{ display: inline; padding-left: 5px; padding-right: 5px; }
相关文章推荐
- Web布局连载——两栏固定布局(五)
- [div+css]晒晒最新制作专题推广页模板
- 盒子模型
- CSS选择器
- CSS样式优先权
- [css] line-height 百分比单位和数值单位的区别
- Apple官网研究之使用Justify布局导航
- 关于前端的思考与感悟
- 设计更快的网页(三):字体和 CSS 调整
- 通晓网络测试常用命令
- 纯CSS制作的新闻网站中的文章列表
- 10条影响CSS渲染速度的写法与使用建议第1/3页
- BS项目中的CSS架构_仅加载自己需要的CSS
- 很不错的 CSS Hack 又学了一招
- 发一个css比较清爽的写法
- CSS expression控制图片自动缩放效果代码[兼容 IE,Firefox]
- css布局网页水平居中常用方法
- CSS经典技巧十则第1/2页
- css 兼容性问题this.style.cursor=''hand''