前言:weui是一个专门用于开发手机移动web或微信的样式库。但是官方只提供了demo没有提供相关文档,所以这篇博客就当是方便以后开发而使用吧。
weui资源下载(也可以从官网下载):
http://download.csdn.net/download/zhengyikuangge/9940737
...
;2、页面上加入
。weui.css在上述weui资源中有,请自行下载。大约是在weui-1.1.2\dist\example 路径下。也可到我的百度网盘下载,链接:http://pan.baidu.com/s/1cFAHNS 密码:iq4d。
该博客中的代码原理上只是修改了html标签中的class而已,请大家对照效果图和代码。
效果图如下:
<a class="weui-btn weui-btn_primary">普通按钮a>
<a class="weui-btn weui-btn_primary weui-btn_loading"><i class="weui-loading">i>a>
<a class="weui-btn weui-btn_disabled weui-btn_primary">不可点按钮a>
<a class="weui-btn weui-btn_mini weui-btn_primary">按钮a>
<a class="weui-btn weui-btn_mini weui-btn_default">按钮a>
<a class="weui-btn weui-btn_mini weui-btn_warn">按钮a>
<a class="weui-btn weui-btn_primary" style="background:yellow">普通按钮a>
<div class="weui-cells weui-cells_radio">
<label class="weui-cell weui-check__label" for="x11">
<div class="weui-cell__bd">
<p>1111p>
div>
<div class="weui-cell__ft">
<input type="radio" class="weui-check" name="radio1" id="x11"/>
<span class="weui-icon-checked">span>
div>
label>
<label class="weui-cell weui-check__label" for="x12">
<div class="weui-cell__bd">
<p>2222p>
div>
<div class="weui-cell__ft">
<input type="radio" name="radio1" class="weui-check" id="x12" checked="checked"/>
<span class="weui-icon-checked">span>
div>
label>
div>
<div class="weui-cells weui-cells_checkbox">
<label class="weui-cell weui-check__label" for="s11">
<div class="weui-cell__hd">
<input type="checkbox" class="weui-check" name="checkbox1" id="s11" checked="checked"/>
<i class="weui-icon-checked">i>
div>
<div class="weui-cell__bd">
<p>standard is dealt for u.p>
div>
label>
<label class="weui-cell weui-check__label" for="s12">
<div class="weui-cell__hd">
<input type="checkbox" name="checkbox1" class="weui-check" id="s12"/>
<i class="weui-icon-checked">i>
div>
<div class="weui-cell__bd">
<p>standard is dealicient for u.p>
div>
label>
div>
<div class="weui-cells weui-cells_form">
<div class="weui-cell">
<div class="weui-cell__hd">div>
<div class="weui-cell__bd">
class="weui-input" type="number" pattern="[0-9]*" placeholder="请输入qq号"/>
div>
div>
<div class="weui-cell">
<div class="weui-cell__hd">div>
<div class="weui-cell__bd">
class="weui-input" type="date" value=""/>
div>
div>
<div class="weui-cell">
<div class="weui-cell__hd">div>
<div class="weui-cell__bd">
class="weui-input" type="datetime-local" value="" placeholder=""/>
div>
div>
div>
<div class="weui-cell weui-cell_switch">
<div class="weui-cell__bd">标题文字div>
<div class="weui-cell__ft">
class="weui-switch" type="checkbox" checked="checked"/>
div>
div>
<div class="weui-cells">
<div class="weui-cell">
<div class="weui-cell__bd">
class="weui-input" type="text" placeholder="请输入文本"/>
div>
div>
div>
<div class="weui-cells weui-cells_form">
<div class="weui-cell">
<div class="weui-cell__bd">
<div class="weui-textarea-counter" id="shownumber">0/200div>
div>
div>
div>
<div class="weui-cell weui-cell_select">
<div class="weui-cell__bd">
<select class="weui-select" name="select1">
<option selected="" value="1">微信号option>
<option value="2">QQ号option>
<option value="3">Emailoption>
select>
div>
div>
<div class="weui-cell weui-cell_select weui-cell_select-after">
<div class="weui-cell__hd">
<label for="" class="weui-label">国家/地区label>
div>
<div class="weui-cell__bd">
<select class="weui-select" name="select2">
<option value="1">中国option>
<option value="2">美国option>
<option value="3">英国option>
select>
div>
div>
<label for="weuiAgree" class="weui-agree">
<input id="weuiAgree" type="checkbox" class="weui-agree__checkbox"/>
<span class="weui-agree__text">
阅读并同意<a href="javascript:void(0);">《相关条款》a>
span>
label>