好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

如何在导航栏添加hot样式图片_html/css_WEB-ITnose

如何在导航栏添加hot样式图片:
建议:尽可能的手写代码,可以有效的提高学习效率和深度。
在很多网站的导航栏中都有这样的效果,在一个比较热门的栏目上面会有一个动态的小图片用以标示此栏目比较热门或者是新增栏目等等,效果比较美观且人性化,下面就简单介绍一下如何实现此效果,先看一段代码实例:

      蚂蚁部落  * {  padding: 0px;  margin: 0px;}body {  font: 12px;  margin-top: 80px;}li {  list-style: none;}a {  text-decoration: none;  color: #20537A;}.clearfix:after {  content: "\0020";  display: block;  height: 0;  clear: both;}.clearfix {  _zoom: 1;}* + html .clearfix {  overflow: auto;}.menu_navcc {  width: 970px;  margin: 0 auto;}.menu_nav {  width: 970px;  height: 48px;  background: url(mytest/div+css/mynav_bg.gif) repeat-x;  float: left;  margin-top: 18px;}.menu_nav .nav_content {  padding-left: 25px;  background: url(mytest/div+css/mynav_l_bg.gif) no-repeat;  float: left;}.menu_nav .nav_content li {  width: 88px;  height: 48px;  padding-left: 15px;  padding-right: 13px;  background: url(mytest/div+css/mynav_li_right.gif) no-repeat right center;  float: left;  line-height: 48px;  text-align: center;  font-size: 14px;  font-weight: bold;}.menu_nav .nav_content li a {  color: #fff;  width: 88px;  height: 48px;  display: block;}.menu_nav .nav_content li.current {  line-height: 37px;}.menu_nav .nav_content li em {  background: url(mytest/div+css/bid_new.gif) no-repeat;  width: 35px;  height: 21px;  display: inline-block;  position: absolute;  top: -20px;  left: 40px;}.menu_nav .nav_content li.current a, .menu_nav .nav_content li a:hover {  width: 88px;  height: 37px;  background: url(mytest/div+css/mynav_li_current.gif) no-repeat;  display: block;  color: #fff;} .menu_nav .nav_content li a:hover {  background: url(mytest/div+css/mynav_li_hover.gif) no-repeat;  line-height: 37px;  text-decoration: none;}.menu_nav_right {  padding-right: 20px;  background: url(mytest/div+css/mynav_r_bg.gif) no-repeat right top;  float: right;  margin-left: 50px;  padding-top: 13px;  height: 23px;  padding-bottom: 12px;}p {  margin-bottom: 15px;}     

查看更多关于如何在导航栏添加hot样式图片_html/css_WEB-ITnose的详细内容...

  阅读:40次