Win8出来已有一段时间了,个人是比较喜欢Metro UI的。一直以来想用Metro UI来做个自己的博客,只是都没有空闲~~今天心血来潮,突然想自己弄一个磁贴玩玩,动手……然后就有了本篇。

Win8中的磁贴可调整大小,分组,还有更好玩的动态信息显示。网上也有了比较完整的Web Metro UI框架库,比较好的一个——Metro UI template:http://metro-webdesign.info/,(这个是收费的),还有许多其它的,可参看园子里园友(梦想天空)列举的:http://www.cnblogs.com/lhb25/archive/2013/04/11/10-metro-bootstraps-ui-templates.html

本篇的磁贴只实现了简单的磁贴样式和选中效果,用CSS实现。考虑到磁贴的可选中性,想到了html中的复选框,核心原理其实就是用css伪类来实现。

先看效果截图吧:

看代码(很简单,也可在这里http://runjs.cn/detail/mirwgdac fork一份,实现你自己的,同时向大家推荐runjs.cn,这个真不错,和jsfiddle有的比。也欢迎关注我x-strong :)):

 <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
Metro UI试手之Tile
</title>
<style type='text/css'>
body{font-family:'微软雅黑';
background-color:#8b37f1;}
p{color:white;}
.tile{
display:inline-block;
width:200px;
height:100px;
margin:5px;
padding:0;
background-color:blue;
color:white;
font-family:'微软雅黑';
font-size:30px;
vertical-align:middle;
} .tile-yellow{
background-color:yellow;
color:blue;
} .tile-green{
background-color:green;
color:white;
}
.tile label{
width:200px;
height:100px;
display:block;
}
.content{
display:inline-block;
height:100px;
width:200px;
line-height:100px;
vertical-align:middle;
text-align:center;
}
.tile input[type='checkbox']{
float:right;
display:none;
}
.symbol{
display:inline-block !important;
width:40px;
height:40px;
position:relative;
top:2px;
right:2px;
float:right;
margin-bottom:-40px;
}
.tile input[type='checkbox']:checked ~.symbol{
background-image:url('http://sandbox.runjs.cn/uploads/rs/169/rvy7e5su/tile_selected_symbol.png');
}
</style>
</head>
<body>
<p>
Metro UI之磁贴(Tile)
</p>
<div class='tile'>
<label> <input type='checkbox' />
<span class='symbol'>
 
</span>
<span class='content'>
简单磁贴
</span>
</label>
</div>
<div class='tile tile-yellow'>
<label> <input type='checkbox' />
<span class='symbol'>
 
</span>
<span class='content'>
简单磁贴
</span>
</label>
</div> <div class='tile tile-green'>
<label> <input type='checkbox' />
<span class='symbol'>
 
</span>
<span class='content'>
简单磁贴
</span>
</label>
</div>
</body>
</html>

Metro UI之磁贴(Tile)

  简单磁贴
  简单磁贴
  简单磁贴

也来“玩”Metro UI之磁贴(一)的更多相关文章

  1. 也来“玩”Metro UI之磁贴

    也来“玩”Metro UI之磁贴 Win8出来已有一段时间了,个人是比较喜欢Metro UI的.一直以来想用Metro UI来做个自己的博客,只是都没有空闲~~今天心血来潮,突然想自己弄一个磁贴玩玩, ...

  2. 也来“玩”Metro UI之磁贴(二)

    继昨天的“也来“玩”Metro UI之磁贴(一)”之后,还不过瘾,今天继续“玩”吧——今天把单选的功能加进来,还有磁贴的内容,还加了发光效果(CSS3,IE9+浏览器),当然,还是纯CSS,真的要感谢 ...

  3. ”Metro UI之磁贴(二)

    也来“玩”Metro UI之磁贴(二) 继昨天的“也来“玩”Metro UI之磁贴(一)”之后,还不过瘾,今天继续“玩”吧——今天把单选的功能加进来,还有磁贴的内容,还加了发光效果(CSS3,IE9+ ...

  4. 磁贴界面颜色 Metro UI Colors

    http://www.oschina.net/p/metro-ui-colors 介绍 包含了磁贴界面(Metro UI)使用的颜色集合(浅绿色,绿色,深绿色,品红,紫色等).可以查看每一种颜色的各种 ...

  5. 7 款免费的 Metro UI 模板

    #1 – Free Metro Ui Style template by Asif Aleem 很棒的蓝色调 Metro UI 管理模板 #2: Metro-Bootstrap by TalksLab ...

  6. Bootstrap看厌了?试试Metro UI CSS吧

    (此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:Bootstrap作为一款超级流行的前端框架,已经成为很多人的首选,不过有时未免有点审 ...

  7. 使用WPF来创建 Metro UI程序

    本文转载:http://www.cnblogs.com/TianFang/p/3184211.html 这个是我以前网上看到的一篇文章,原文地址是:Building a Metro UI with W ...

  8. 【今日推荐】10大流行的 Metro UI 风格的 Bootstrap 主题和模板

    1. BootMetro 基于 Twitter Bootstrap 的简单灵活的 HTML.CSS 和 Javascript 框架,Win8 风格,大爱啊! 立即下载     效果演示 2. Boot ...

  9. Metro UI 界面完全解析 (转载)

    Metro在微软的内部开发名称为“ typography-based design language”(基于排版的设计语言).它最早出现在微软电子百科全书95,此后微软又有许多知名产品使用了Metro ...

随机推荐

  1. Todolist总结

    一.组件类里面的函数尽可能写成箭头函数的形式,方便绑定this 上面的箭头函数是好的,写面的不好,他需要在用的时候绑定this,或者在constructor绑定,如下: 如上用的时候绑定this是不好 ...

  2. iOS 自适应高度,改变字体颜色

    #define kMainBoundsWidth ([UIScreen mainScreen].bounds).size.width //屏幕的宽度 #define kFont [UIFont sys ...

  3. 网页设计必备工具 firefox Web Developer插件 CSS工具组教程

    该插件在火狐浏览器中安装.Web Developer 插件强大的功能超乎你的想象,用于CSS网页布局开发调试只是它强大功能的一部分,对于网络程序的开发也提供了非常强大的辅助设计功能,我们不将它完全的展 ...

  4. copyin函数

    详见:http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.kerneltechref%2Fdoc%2Fk ...

  5. Yii 2.0排序功能的使用

    在Yii2.0项目的实际开发中,经常会遇到使用Yii2.0自带的排序功能.下面是排序功能的具体使用方法. 一.设置排序规则 注意引入Sort类,如:use yii\data\Sort; // 设置排序 ...

  6. SIT&UAT

  7. MySQL检查死锁简介

  8. 解决Genymotion Error: “Unable to load VirtualBox Engine” on Yosemite. VirtualBox installed

    Mac 环境,输入命令 sudo ln -s /usr/local/bin/VBoxManage /usr/bin/VBoxManage

  9. UVA Live 3713 Astronauts (2-SAT)

    用布尔变量表示状态,把限制条件转化为XνY的形式以后跑2SAT,根据变量取值输出方案. #include<bits/stdc++.h> using namespace std; ; #de ...

  10. Django 模型ORM

    from django.db import models # Create your models here. class Book(models.Model): nid = models.AutoF ...