做了一个手机客户端页面,未登录的状态页面

类似 如上图所示 这样

上面列表采取80%宽度,右侧浮动。ul li设置绝对定位。左边icon图标采取决定定位。

为了防止小屏幕手机左边空白缝隙过小,事先给外面层设置一个padding-left;留出空白间隙

因为上面ul列表使用了浮动,所以下面的button按钮(内联元素)会和上面在一行。这个时候对button设置display:block;clear:both;清除浮动,button即可下来显示。

或者在ul外面嵌套一层div.给这个嵌套的div设置clearfix。

==================

.clearfix:after {
content: ".";
display: block;
height: 0;
visibility: hidden;
clear: both;
}

.clearfix {
*zoom: 1;
}

开始我想的是,clearfix应该添加在本身元素ul上,其实不是。又尝试把clearfix样式添加在 ul和button的父元素外面。又不对。这是没有弄清楚clearfix这个属性

.clearfix:after {       <----在类名为“clearfix”的元素内最后面加入内容;
    content: ".";     <----内容为“.”就是一个英文的句号而已。也可以不写。
    display: block;   <----加入的这个元素转换为块级元素。
    clear: both;     <----清除左右两边浮动。
    visibility: hidden;      <----可见度设为隐藏。注意它和display:none;是有区别的。仍然占据空间,只是看不到而已;
    height: 0;     <----高度为0;
    font-size:0;    <----字体大小为0;
}

整段代码就相当于在浮动元素后面跟了个宽高为0的空div,然后设定它clear:both来达到清除浮动的效果。(这个css的原理是经过使用 after伪对象,它将在应用clearfix的元素结尾添加content中的内容,也就是一个".",并且把他设置为块级元素 (display="block");高度设置为0,clear="both",然后将其内容隐藏掉(visibility="hidden").这样就会撑开此块级元素.)

之所以用它,是因为,你不必在html文件中写入大量无意义的空标签,又能清除浮动。
.clearfix { *zoom:1;}   <----这是针对于IE6的,因为IE6不支持:after伪类,这个神奇的zoom:1让IE6的元素可以清除浮动来包裹内部元素。具体意思的话,不用深究,听说微软的工程师自己都无法解释清楚。height:1%效果也是一样。、

参考:http://blog.sina.com.cn/s/blog_60b35e830101c1r8.html

==========================

还有一个难点就是  中间文字左右横线的,分割线,展示

<div class="dividing-line">或</div>

.dividing-line {
width: 80%;
margin: 0 auto;
text-align: center;
height: 30px;
line-height: 30px;
position: relative;
}

.dividing-line:before {
content: "";
width: 46%;
height: 1px;
background-color: #DEDEDE;
display: block;
right: 8px;
bottom: 13px;
position: absolute;
}

.dividing-line:after {
content: "";
width: 46%;
height: 1px;
background-color: #DEDEDE;
display: block;
left: 8px;
bottom: 13px;
position: absolute;
}

参考:http://www.daqianduan.com/4258.html

=============HTML==================

<!doctype html>
<html>

<head>
<title>未登录 </title>
<meta charset="utf-8" />
<meta name="viewport" content="width=100%, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" />
<meta content="telephone=no" name="format-detection" />
<meta name="apple-mobile-web-app-title" content="贷款助手">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1">
<link href="css/base.css" type="text/css" rel="stylesheet" />
<link href="css/unknown.css" type="text/css" rel="stylesheet" />
</head>

<body>
<section class="box-sizing">
<ul class="unknown-form">
<li class="tab unknown-ziliao"><a href="javascript:void(0);">我的资料<span class="arrow">&gt;</span></a></li>
<li class="tab unknown-mingpian"><a href="javascript:void(0);">生成名片<span class="arrow">&gt;</span></a></li>
<li class="tab unknown-wenti"><a href="javascript:void(0);">常见问题<span class="arrow">&gt;</span></a></li>
<li class="tab unknown-jieshao"><a href="javascript:void(0);">公司介绍<span class="arrow">&gt;</span></a></li>
</ul>
<button class="clear button login">登录</button>
<div class="dividing-line">或</div>
<button class="clear button register">登录</button>
</section>

</body>

</html>

===========CSS===============

html,
body {
max-width: 640px;
background: #FFFFFF;
margin: 0 auto;
font-size: 62.5%;
}

.box-sizing {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
-o-box-sizing: border-box;
padding-left:2rem;
}

.clearfix:after {
content: ".";
display: block;
height: 0;
visibility: hidden;
clear: both;
}

.clearfix {
*zoom: 1;
}

.unknown-form {
width: 86%;
float: right;
margin-bottom: 3.5rem;
}

.unknown-form li {
height: 7;
line-height: 7rem;
border-bottom: 1px #E9E9E9 solid;
position: relative;
}

.unknown-form li a {
color: #000000;
font-size: 1.6rem;
display: block;
}

.unknown-form li .arrow {
float: right;
margin-right: 1rem;
color: #dedede;
}

.unknown-form .tab:before {
content: '';
display: block;
width: 45px;
height: 45px;
position: absolute;
left: -6rem;
top: 1.4rem;
}

.unknown-form .unknown-ziliao:before {
background: url(../images/unknown-ziliao.png) no-repeat;
background-size: 45px 45px;
}

.unknown-form .unknown-mingpian:before {
background: url(../images/unknown-mingpian.png) no-repeat;
background-size: 45px 45px;
}

.unknown-form .unknown-wenti:before {
background: url(../images/unknown-wenti.png) no-repeat;
background-size: 45px 45px;
}

.unknown-form .unknown-jieshao:before {
background: url(../images/unknown-jieshao.png) no-repeat;
background-size: 45px 45px;
}

.clear {
clear: both;
display: block;
}

.button {
width: 80%;
height: 3.5rem;
line-height: 3.5rem;
border: none;
color: #FFFFFF;
border-radius: 2px;
font-size: 2.1rem;
margin: 0 auto;
cursor: pointer;
}

.login {
background: #318AE4;
}

.register {
background: #5BB049;
}

.dividing-line {
width: 80%;
margin: 0 auto;
text-align: center;
height: 30px;
line-height: 30px;
position: relative;
font-size:1.4rem;
}

.dividing-line:before {
content: "";
width: 46%;
height: 1px;
background-color: #DEDEDE;
display: block;
right: 0px;
bottom: 15px;
position: absolute;
}

.dividing-line:after {
content: "";
width: 46%;
height: 1px;
background-color: #DEDEDE;
display: block;
left: 0px;
bottom: 15px;
position: absolute;
}

========================

链接:http://files.cnblogs.com/files/leshao/unknown-02%E7%89%88%E6%9C%AC.rar

客户端 未登录页面 (clearfix 分割线)的更多相关文章

  1. vue实现未登录跳转到登录页面

    环境:vue 2.9.3; webpack;vue-router 目的:实现未登录跳转 例子:直接在url地址栏输入...../home,但是这个页面要求需要登陆之后才能进入,判断的值就通过登陆之后给 ...

  2. jsp+js完成用户一定时间未操作就跳到登录页面

    <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" ...

  3. play for scala 实现SessionFilter 过滤未登录用户跳转到登录页面

    一.编写SessionFilter.scala代码 package filters import javax.inject.{Inject, Singleton} import akka.stream ...

  4. php实现:当未登录时转到登陆页面

    判断session是否存在,不存在则跳转到登录页面session_start(); if ( !$_SESSION['xxx'] ) {    header("Location: login ...

  5. think php 未登录,禁止访问页面 + 退出登录

    1.首先在Local创建一个基类控制器 D:\PHP\phpstudy_pro\WWW\1906A\pyg>php think make:controller goods/Base --plai ...

  6. C#-WebForm-Session、Cookie-登录验证(未登录跳至登录界面)、隐藏地址栏传值

    Post 传值(看不见的传值) Get 传值(看得见的传值) Session - 全局变量组 存放位置:服务端 作用:只要里面有内容,那么这个网站中所有的C#端都能访问到这个变量 -- object类 ...

  7. 解决使用IE8打开ADFS 3.0登录页面

    系统上线前一天,发现客户竟然有XP系统和2003系统,这些系统都不能访问外网.测试时,客户端是IE8,打开我们系统ADFS的登录页面,一直在Loading,无法打开,也不报错.后来通过fiddler跟 ...

  8. 今天网站后台登录页面需要生成一个二维码,然后在手机app上扫描这个二维码,实现网站登录的效果及其解决方案如下

    要实现二维码登录,需要解决2个技术,1.需要js websocket 与后台php实现长连接技术 2.实现二维码生成技术 要实现这个功能第二个算是比较简单,只需要下载一个php的二维码生成器即可,但要 ...

  9. struts 用拦截器进行用户权限隔离,未登录用户跳到登录界面 *** 最爱那水货

    一般,我们的web应用都是只有在用户登录之后才允许操作的,也就是说我们不允许非登录认证的用户直接访问某些页面或功能菜单项.对于个别页面来说,可能不需要进行拦截,此时,如果项目采用struts view ...

随机推荐

  1. Tomcat启动慢解决方法(本人CentOS7.4系统)

    首先查看日志信息,查看因为什么而启动慢 在CentOS7启动Tomcat时,启动过程很慢,需要几分钟,经过查看日志,发现耗时在这里:是session引起的随机数问题导致的.Tocmat的Session ...

  2. 剑指Offer_5_替换空格

    题目描述 请实现一个函数,将一个字符串中的空格替换成"%20". 例如,当字符串为We Are Happy.则经过替换之后的字符串为 We%20Are%20Happy. 在网络编程 ...

  3. Python Django CMDB项目实战之-1如何开启一个Django-并设置base页、index页、文章页面

    1.环境 win10 python 2.7.14 django 1.8.2 需要用到的依赖包:MySQLdb(数据库的接口包).PIL/pillow(处理图片的包) 安装命令: pip install ...

  4. BestCoder Round #75 King&#39;s Cake 模拟&amp;&amp;优化 || gcd

    King's Cake Accepts: 967 Submissions: 1572 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 6553 ...

  5. 基于Handler架构的录音程序

    近期我的app须要一个录音功能,于是搜到这篇文章 文章中录音线程与主线程间的通讯是通过内部类訪问外部类成员变量的方式来实现 while (isRecord == true) { //isRecord是 ...

  6. linux shell 推断文件或目录是否真的存在

    #推断文件或目录是否存在 filepath=/data/test.txt folderpath=/data/qtech #推断文件是否存在 if [ -f "$file" ] th ...

  7. jquery 自定义选择器

    // HTML 代码 <body> <div id="divid1" class="divclass">白色</div> & ...

  8. Django的缓存机制

    由于Django是动态网站,所有每次请求均会去数据进行相应的操作,当程序访问量大时,耗时必然会更加明显,最简单解决方式是使用:缓存,缓存将一个某个views的返回值保存至内存或者memcache中,5 ...

  9. Intellij IDEA编译代码出现红色标志

    如图 原因:项目没有模块化加载 解决方法: 快捷键 Ctrl+Alt+Shift+S 进入 Project Structure 界面,选择 Modules --> Sources -->选 ...

  10. linux部署服务器遇到tomcat already start

    linux部署服务器遇到tomcat already start 前言,之前做了个汽车停车计费的后端,然后现在需要部署到服务器.正常部署,使用secureFx找到所属webapps目录,将文件上传.然 ...