移动端布局Demo展示图文
上两张图自勉一下(来自刘墉先生的文章,最近看他的作品):然后移动端该愈来愈受到重视,未来的市场我不知道,不过我知道手机的功能越来越强大是不争的事实!移动端布局的积累也需要从现在做起!
需求一:实现下图效果,注意不同手机的型号:原生称为适配,我们称为自适应不变形
思路一:btn+ima布局风格
<div class="row margin-top">
<div class="col-sm-12">
<div class="form-group text-centr">
<button type="submit" class="btn btn-default ubBtn">
乘客快捷注册
<!-- <i class="check" style="padding-left:3.0rem"> </i> -->
<!-- <img src="./image/checks.png" style="width:20px;height:20px;position: relative;right: -1.6rem;"> -->
</button>
<img src="./image/checks.png" style="width: 20px; height: 20px; position: absolute; top: 3.6rem; right: 0.5rem;">
</div>
</div>
</div>
思路二:div 左右布局风格
<div class="row margin-top">
<div class="col-sm-8">
<button type="submit" class="btn btn-default ubBtn2" >
新用户注册
</button>
</div>
<div class="col-sm-4">
<img src="./image/checks.png" style="width: 20px; height: 20px;float: right;margin-top: -1rem;margin-right: 0.3rem;">
</div>
</div>
思路三:div 左右布局风格2
<div class="row margin-top">
<div class="col-sm-8">
<a href="#" class="btn btn-a">新用户注册
<span class="msg-span"> </span>
</a>
</div>
<!-- <div class="col-sm-4">
<img src="./image/checks.png" style="width: 20px; height: 20px;float: right;margin-top: -1rem;margin-right: 0.3rem;">
</div> -->
</div>
这个需要<span>有占位,然后如果左侧文字不定 做出来效果也不是很理想,适合固定的界面模式 然后设置span的左边距离
思路四:ul li a span布局
<!-- ul li a span 布局 -->
<div class="row margin-top">
<div class="col-sm-12 navlink">
<ul>
<li>
<a href="">乘客快捷注册
<span class="moreicon">></span>
</a>
</li>
<li>
<a href="">新用户注册
<span class="moreicon">
<img src="./image/checks.png" style="width: 20px; height: 20px;float: right;margin-right: 0.3rem;margin-top: 0.2rem;">
</span>
</a> </li>
</ul>
</div>
</div>
思路五:期待补充中
统一css样式整理:
.wrap-page{background:#ffffff;}
.nav-box{text-align:center;margin-top: 1.0rem}
.success{width:100%;margin:2.65625rem auto;}
.share-txt{font-size: 0.4375rem}
.logo{width: 3.109375rem;margin: 2.5625rem auto auto auto;}
.top-blank{height:0.6875rem;}
.top{background:#1FBAD6;height:10.0rem;}
.content{position: fixed;left: 0.2rem;right: 0.2rem;top: 5.0rem;background: #ffffff;margin: auto 0;width: 96%;}
.content-bg{width: 92%;margin: auto 0;position: relative;left: 0.4rem;}
.div-select{background: #1FBAD6;margin-top: 0.4rem;padding: 0.25rem}
.footer{height: 5.0rem}
.margin-top{margin-top: 0.25rem;}
.ubBtn{width:100%;margin:auto;display:block;height: 1.48rem;color:#1FBAD6;font-weight:}
.ubBtn2{width:100%;margin:auto;display:block;height: 1.48rem;color:#1FBAD6;font-weight:}
.check{background: url(../image/checks.png) right;background-repeat: no-repeat;background-size: 0.55rem 0.55rem;}
.box4{margin: 0 auto;width: 10px;height: 0px;border: 20px solid transparent;border-bottom-color: #1FBAD6;}
.btn-a{background:#ffffff;line-height: 28px;width: 100%;}
.msg-span{background: url(../image/checks.png) right;background-repeat: no-repeat;background-size: 0.55rem 0.55rem;}
.navlink li {
width: 100%;
position: relative;
margin-bottom: 2%;
}
.navlink li a {
text-align: center;
font-size: 11pt;
display: block;
height: 1.48rem;
line-height: 1.2rem;
/*border-radius: 20px;*/
border-radius: 4px;
background: #ffffff none repeat scroll 0% 0%;
border-width: 1px;
border-style: solid;
border-color: #202329 #202329 #393E48;
-moz-border-top-colors: none;
-moz-border-right-colors: none;
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
border-image: none;
padding: 4px 0px;
}
参考:
使用Flexible实现手淘H5页面的终端适配:http://www.w3cplus.com/mobile/lib-flexible-for-html5-layout.html
移动端布局Demo展示图文的更多相关文章
- Android ListView分页载入(服务端+android端)Demo
Android ListView分页载入功能 在实际开发中经经常使用到,是每一个开发人员必须掌握的内容,本Demo给出了服务端+Android端的两者的代码,并成功通过了測试. 服务端使用MyEcli ...
- lesson5:Condition的原理分析及demo展示
Condition 将 Object 监视器方法(wait,notify,和notifyAll)分解成截然不同的对象,以便通过将这些对象与任意Lock实现组合使用,为每个对象提供多个等待 set(wa ...
- jqm的多列布局demo,html5的多列布局demo,多列布局的具体解说,html5开发实例具体解释
因为移动设备屏幕宽度较小,所以一般不建议使用多列布局.但有时你可能须要并排放置一些元素(如button之类的). jQuery Mobile通过约定的类名ui-grid来提供了一种基于css的多列布局 ...
- Netty4 学习笔记之一:客户端与服务端通信 demo
前言 因为以前在项目中使用过Mina框架,感受到了该框架的强大之处.于是在业余时间也学习了一下Netty.因为Netty的主要版本是Netty3和Netty4(Netty5已经被取消了),所以我就直接 ...
- 用css巧妙实现移动端横向滑动展示功能
前言:记得以前处理移动端横向滑动展示都是去用js去解决的,要用js进行蛮多处理,要算li的宽度,然后还要用js设置ul盒子的宽度,又要设置最大滑动距离,最小滑动距离等等.......但是现在发现用cs ...
- 移动端布局 - REM方式
默认以宽度为640px的设计稿为基准页面,然后通过JS获取当前显示设备的尺寸,对应的调整 html 标签的font-size大小,从而实现通过以rem为单位的移动端布局适配. 具体代码 (functi ...
- 前端切图:手机端自适应布局demo
手机端自适应布局demo原型如下: 图片发自简书App 要求如下:适应各种机型源码如下: <!DOCTYPE html > <html> <head> <me ...
- 【css】用css巧妙实现移动端横向滑动展示功能
前言:记得以前处理移动端横向滑动展示都是去用js去解决的,要用js进行蛮多处理,要算li的宽度,然后还要用js设置ul盒子的宽度,又要设置最大滑动距离,最小滑动距离等等.......但是现在发现用cs ...
- 移动端布局的一些设置(在viewport里设置使页面显示相同宽度,显示相同像素大小)
viewport(视口) 具体数值(不设置时默认为980 ,部分安卓手机不支持设置成具体数值) width=device-width 和设备宽度保持一致 user-scalable=no 是否允许用户 ...
随机推荐
- 获得设备型号(含iPhone6 , iPhone 6+)
//获得设备型号 + (NSString *)getCurrentDeviceModel:(UIViewController *)controller { int mib[2]; size_t len ...
- spring jdbc.property的配置与使用
jdbc.properties driver=com.mysql.jdbc.Driver url=jdbc:mysql://127.0.0.1:3306/ssi1 username=root pass ...
- 微支付开发(.net)
最近一周多进行微支付开发工作,总结一下关于微支付开发中遇到的问题. 如写得不对请大家提出,第一次自己写文章.嘿嘿... 1.申请微支付,登陆公众平台后(公众号为服务号并已认证),进入“服务”-“服务中 ...
- 关于ListView的 addHeaderView(...) 方法
在代码中使用 listView .addHeaderView(...) 方法可以在ListView组件上方添加上其他组件,并且连结在一起像是一个新组件.如果多次使用 .addHeaderView(.. ...
- HDU5668 Circle 非互质中国剩余定理
分析:考虑对给定的出圈序列进行一次模拟,对于出圈的人我们显然可以由位置,编号等关系得到一个同余方程 一圈做下来我们就得到了n个同余方程 对每个方程用扩展欧几里得求解,最后找到最小可行解就是答案. 当然 ...
- acm位运算应用 搜索
acm位运算应用 搜索 搜索 此处不讲题目,只讲位运算是怎样在这些题中实现和应用的.由于搜索题往往是基于对状态的操作,位运算往往特别有效,优化之后的效果可以有目共睹. 例1.POJ 132 ...
- [liu yanling]常用的测试工具
常用的测试工具 1. 功能测试工具——QTP 2. 性能测试工具——LoadRunner 3. 测试管理工具——TestDirector 4. 白盒测试工具——Nunit,Junit,C++Test, ...
- Selenium 处理windows 上传 窗口
selenium无法控制windows窗口,故需要引用第三方工具autoit. 在如下网址,下载并安装 http://www.autoitscript.com/site/autoit/ 安装autoi ...
- 洛谷P1189 逃跑的拉尔夫(SEARCH)
洛谷1189 SEARCH 题目描述 年轻的拉尔夫开玩笑地从一个小镇上偷走了一辆车,但他没想到的是那辆车属于警察局,并且车上装有用于发射车子移动路线的装置. 那个装置太旧了,以至于只能发射关于那辆车的 ...
- Codeforces Round #343 (Div. 2) B. Far Relative’s Problem
题意:n个人,在规定时间范围内,找到最多有多少对男女能一起出面. 思路:ans=max(2*min(一天中有多少个人能出面)) #include<iostream> #include< ...