zoukankan      html  css  js  c++  java
  • Html5,css3菜单

    实现的难点在于:first-child,last-child 两个选择器,以后margin-left:-1px;的应用,33%,34%宽度的技巧处理。

    另外一个难点是:box-shadow:1px 0 0 #F1F1F1 inset; 的实现。

    最后是:background:-webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#b6b4b4));background:-moz-linear-gradient(top, #f9f9f9, #b6b4b4);background:-o-linear-gradient(top, #f9f9f9, #b6b4b4);background:linear-gradient(top, #f9f9f9, #b6b4b4); 


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>html5,css3菜单</title>
    <style type="text/css">
    .jikey_demo{ 80%; margin:0 auto; background:#f1f1f1;}
    .news_info{margin-bottom:5px;border:1px solid #bbb;border-radius:5px;box-shadow:0 1px 0 #f1f1f1;}
    .news_info a{display:inline-block;34%;height:26px;margin-left:-1px;font-family:"微软雅黑";line-height:26px;text-align:center;color:#555;border-right:1px solid #ccc;box-shadow:1px 0 0 #F1F1F1 inset;}
    .news_info a:first-child{33%;box-shadow:none;margin-left:0px;}
    .news_info a:last-child{33%;border-right:none;margin-left:-1px;}
    .news_info a:hover, .news_info a.current{color:#208edd;background:-webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#b6b4b4));background:-moz-linear-gradient(top, #f9f9f9, #b6b4b4);background:-o-linear-gradient(top, #f9f9f9, #b6b4b4);background:linear-gradient(top, #f9f9f9, #b6b4b4);}
    .news_info a:hover:first-child, .news_info a.current:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px;}
    .news_info a:hover:last-child, .news_info a.current:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px;}
    </style>
    </head>
    <body>
    <div class="jikey_demo">
    <nav class="news_info"><a class="current" href="/news/">新闻1</a><a class="" href="/guide/">新闻2</a><a class="" href="/review/">新闻3</a></nav>
    </div>
    </body>
    </html>


     
    分类: CSS
  • 相关阅读:
    Windows Phone 7 中常用Task
    设置Highchart柱子最大宽度( 让 highcharts支持maxPointWidth属性)
    Asp.Net MVC 使用FileResult导出Excel数据文件
    js获取网页高度
    使用window.addEventListener 和 window.attachEvent 判断浏览器
    slimscroll滚动条插件简单用法
    js中如何快速获取数组中的最大值最小值
    js 判断浏览器类型
    python使用ldap进行用户认证
    关于go声明切片的一些疑问
  • 原文地址:https://www.cnblogs.com/Leo_wl/p/2666209.html
Copyright © 2011-2022 走看看