• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com专业计算机教程网站
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure
您的位置:首页 > 网页设计 >css3 > 用CSS3实现Win8风格的方格导航菜单效果

用CSS3实现Win8风格的方格导航菜单效果

作者:佚名 字体:[增加 减小] 来源:互联网 时间:2017-06-02

本文主要包含css3,css3做的网站,css3教程,css3弹性布局,html5+css3入门经典等相关知识,佚名 希望在学习及工作中可以帮助到您

代码如下所示:


/* -------------------------------- */ </p> <p>.menu li {
position: relative;
float: left;
cursor: pointer;
height: 120px;
width: 200px;
margin: 10px 0 0 10px;
color: #fff;
}
.menu li:hover, .menu li:focus {
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, .2)), to(rgba(255, 255, 255, 0)));
background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0));
background-image: -moz-linear-gradient(top, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0));
background-image: -ms-linear-gradient(top, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0));
background-image: -o-linear-gradient(top, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0));
background-image: linear-gradient(top, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0));
}
.menu .cover {
z-index: 2;
}
.menu .cover:focus {
outline: 0;
}</p> <p>/* -------------------------------- */</p> <p>.menu li::after {
content: counter(li);
counter-increment: li;
font: italic bold 10px serif, georgia;
position: absolute;
color: rgba(255, 255, 255, .1);
opacity: 0;
-webkit-transition: all .2s ease-out;
-moz-transition: all .2s ease-out;
-ms-transition: all .2s ease-out;
-o-transition: all .2s ease-out;
transition: all .2s ease-out;
}
.menu li:hover::after, .menu li:focus::after {
font-size: 100px;
opacity: 1;
}
.menu .cover::after {
z-index: -1;
}</p> <p>/* -------------------------------- */ </p> <p>.menu li:nth-child(1), .menu li:nth-child(2), .menu li:nth-child(3) {
margin-top: 0;
}
.menu li:nth-child(1), .menu li:nth-child(4), .menu li:nth-child(7) {
margin-left: 0;
}</p> <p>/* -------------------------------- */ </p> <p>.menu li:nth-child(1), .menu li:nth-child(1) .content, .menu li:nth-child(1) .close {
background-color: #2c618f;
}
.menu li:nth-child(2), .menu li:nth-child(2) .content, .menu li:nth-child(2) .close {
background-color: #91ab31;
}
.menu li:nth-child(3), .menu li:nth-child(3) .content, .menu li:nth-child(3) .close {
background-color: #714a28;
}
.menu li:nth-child(4), .menu li:nth-child(4) .content, .menu li:nth-child(4) .close {
background-color: #e58600;
}
.menu li:nth-child(5), .menu li:nth-child(5) .content, .menu li:nth-child(5) .close {
background-color: #c33a00;
}
.menu li:nth-child(6), .menu li:nth-child(6) .content, .menu li:nth-child(6) .close {
background-color: #7f5dac;
}
.menu li:nth-child(7), .menu li:nth-child(7) .content, .menu li:nth-child(7) .close {
background-color: #5672b7;
}
.menu li:nth-child(8), .menu li:nth-child(8) .content, .menu li:nth-child(8) .close {
background-color: #69003f;
}
.menu li:nth-child(9), .menu li:nth-child(9) .content, .menu li:nth-child(9) .close {
background-color: #393043;
}
/* -------------------------------- */</p> <p>.menu .content {
opacity: 0;
display: none\9;
overflow: hidden;
font: 12px Arial, Helvetica;
position: absolute;
height: 120px;
width: 200px; /* Ideally: height: 100%; width: 100%; but works at it should just in FF */
-webkit-transition: all .3s ease-out;
-moz-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
-o-transition: all .3s ease-out;
transition: all .3s ease-out;
}
.menu .expanded {
opacity: .95;
display: block\9;
overflow: visible;
padding: 40px;
height: 300px;
width: 540px; /* Cover the entire area */
}
.menu li:nth-child(3n) .content { /* 3,6,9 */
right: 0;
}
.menu li:nth-child(3n-1) .expanded { /* 2,5,8 */
left: 50%;
margin-left: -310px;
}
.menu li:nth-child(7) .content, /* 7,8,9 */ .menu li:nth-child(8) .content, .menu li:nth-child(9) .content {
bottom: 0;
}
.menu li:nth-child(4) .expanded, /* 4,5,6 */ .menu li:nth-child(5) .expanded, .menu li:nth-child(6) .expanded {
margin-top: -190px;
top: 50%;
}
/* -------------------------------- */ </p> <p>.menu .title {
position: absolute;
height: 100%;
width: 100%;
text-align: center;
font: italic bold 1em/120px 'trebuchet MS', Arial, helvetica;
opacity: .2;
}
.menu li:hover .title {
opacity: .7;
}
/* -------------------------------- */</p> <p>.menu .close {
display: none;
border: 5px solid #fff;
color: #fff;
cursor: pointer;
height: 40px;
width: 40px;
font: bold 20px/40px arial, helvetica;
position: absolute;
text-align: center;
top: -20px;
right: -20px;
-moz-border-radius: 40px;
-webkit-border-radius: 40px;
border-radius: 40px;
}
.menu .cover .close {
display: block;
}
</style>
<script src="http://demo.weikejianghu.com/jslib/jquery/jquery-1.7.1.min.js"></script>
<!--[if (gte IE 6)&(lte IE 8)]>
<script>
(function(win) {
if (/*@cc_on!@*/true) return;
var doc = document;
var root = doc.documentElement;
var xhr = getXHRObject();
var ieVersion = /MSIE (\d+)/.exec(navigator.userAgent)[1];
if (doc.compatMode != 'CSS1Compat' || ieVersion<6 || ieVersion>8 || !xhr) {
return;
}
var selectorEngines = {
"NW" : "*.Dom.select",
"MooTools" : "$$",
"DOMAssistant" : "*.$",
"Prototype" : "$$",
"YAHOO" : "*.util.Selector.query",
"Sizzle" : "*",
"jQuery" : "*",
"dojo" : "*.query"
};</p> <p> var selectorMethod;
var enabledWatchers = []; // array of :enabled/:disabled elements to poll
var ie6PatchID = 0; // used to solve ie6's multiple class bug
var patchIE6MultipleClasses = true; // if true adds class bloat to ie6
var namespace = "slvzr";

// Stylesheet parsing regexp's
var RE_COMMENT = /(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*/g;
var RE_IMPORT = /@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))[^;]*;/g;<

您可能想查找下面的文章:

  • CSS3阴影 box-shadow的使用和技巧总结
  • CSS3动画特效
  • CSS Transform / Transition / Animation 属性的区别
  • 利用CSS3伪元素实现逐渐发光的方格边框
  • CSS3实现内凹圆角的实例代码
  • 利用HTML5+CSS3实现3D转换效果实例详解
  • css3+伪元素实现鼠标移入时下划线向两边展开的效果
  • CSS3实现自定义Checkbox特效实例代码
  • 总结30个CSS3选择器
  • CSS3模拟动画下拉菜单效果

相关文章

  • 2017-06-02利用CSS3的transform做的动态时钟效果
  • 2017-06-02详解CSS3中@media的实际使用
  • 2017-06-02使用css3和jquery实现可伸缩搜索框
  • 2017-06-02css背景图片的背景裁切、背景透明度、背景变换等效果运用
  • 2017-06-02CSS3 实用技巧:实现黑白图像效果示例代码
  • 2017-06-02CSS3实现时间轴效果
  • 2017-06-02CSS3绘制超炫的上下起伏波动进度加载动画
  • 2017-06-02CSS3 制作绽放的莲花采用效果叠加实现
  • 2017-06-02关于css兼容性问题及一些常见问题汇总
  • 2017-06-02CSS3网格的三个新特性详解

文章分类

  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure

最近更新的内容

    • 两种CSS3伪类选择器详细介绍
    • 纯css3实现的动画按钮的实例教程
    • 详解CSS3阴影 box-shadow的使用和技巧总结
    • CSS3中Animation属性的使用详解
    • CSS3实战第一波 让我们尽情的圆角吧
    • 纯CSS实现的大小渐变、渐远效果
    • 使用CSS3配合IE滤镜实现渐变和投影的效果
    • CSS3圆角和渐变2种常用功能详解
    • 利用CSS3参考手册和CSS3代码生成工具加速来学习网页制
    • CSS3教程:新增加的结构伪类

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有