html+css自定义导航
如意编程网
收集整理的这篇文章主要介绍了
html+css自定义导航
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
利用css来编写的导航条,先看看效果:
代码区:
html:
<!--导航部分--> {block name="nav"} <nav> <div> <ul> <li><a href="{:url('UserManage/index')}"><img src="__PUBLIC__/static/img/logo.jpg"></a></li> <li><a href="{:url('UserManage/index')}">用户管理</a></li> <li><a href="{:url('CaseManage/index')}">用例管理</a></li> <li> <div id="login_name"> <span><i></i> {$Think.session.loginUser->name}</span> </div> <div id="logout"> <a href="{:url('Login/loginOut')}"><i></i> 退出</a> </div> </li> </ul> </div> </nav> {/block}
css:
/*导航部分*/ .nav { background: #000000; height: 60px; margin: 0 auto; } .nav ul { list-style: none; } .nav .first { float: left; } .nav .first img{ width: 120px; height: 60px; } .menu { float: left; line-height: 60px; text-align: center; } .menu a { text-decoration: none; color: white; display: block; width: 85px; height: 60px; font-size: 15px; } .menu a:hover { background: #0f0f0f; color: green; } /*显示用户,退出*/ .nav .last{ float: right; line-height: 60px; margin-right: 20px; text-align: center; } #login_name{ font-size: 15px; color: white; display: inline; } #logout { display: inline; margin-left: 20px; } #logout a{ color: white; text-decoration: none; } /*导航部分*/
总结
以上是如意编程网为你收集整理的html+css自定义导航的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: html2canvas 导出包含滚动条的
- 下一篇: php正则提取html图片(img)sr