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

类似 如上图所示 这样

上面列表采取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. oralce11g导出dmp然后导入Oracle10g

    一次Oracle11g数据库导入 Oracle10g数据库操作笔记 11g备份导入10g的时候会抛错直接阻止导入. 但是有时候还必须得把11g的数据库导入到10g我今天就遇到了这种情况. 一开始 ...

  2. Java爬虫_资源网站爬取实战

    对 http://bestcbooks.com/  这个网站的书籍进行爬取 (爬取资源分享在结尾) 下面是通过一个URL获得其对应网页源码的方法 传入一个 url  返回其源码 (获得源码后,对源码进 ...

  3. Cocos2d-x 3.0 Android改动APK名、更改图标、改动屏幕方向、改动版本,一些须要注意的问题

    非常多新手程序员做出一个游戏后,编译成apk安装在手机上.却发现安装程序名和游戏图标都是Cocos2dx默认的,并且默认屏幕方向是横向.那么须要怎么才干改动为自己想要的呢? 打开你创建的project ...

  4. android boot.img

    android在启动时uboot推断有没有组合健按下或者cache分区的升级文件来决定进入哪个系统(可能还有别的推断方式) 有组合健按下或者cache分区有升级文件,则载入recovery.img进入 ...

  5. 从头认识Spring-2.7 自己主动检測Bean(2)-过滤器&lt;context:include-filter/&gt;

    这一章节我们来讨论一下过滤器<context:include-filter/>的使用. 1.domain Person接口: package com.raylee.my_new_sprin ...

  6. C++ 虚指针、成员变量与类对象的偏移地址

    先给出一段代码实现 #include <iostream> using namespace std; class animal { protected: int age; public: ...

  7. Qt之QHeaderView加入复选框

    简述 前面分享了QTableView中怎样加入复选框. 本节主要介绍QTableView中的表头-QHeaderView加入复选框的功能,以下以水平表头为例.垂直表头相似! 简述 效果 QHeader ...

  8. 通过Graph 浏览器体验Microsoft Graph

    作者:陈希章 发表于 2017年3月18日 上一篇介绍了Microsoft Graph的基本概念,接下来我们快速体验一下Microsoft Graph到底能做什么? 为了帮助开发人员直观和快速体验Mi ...

  9. Sql去重

    distinct:用于返回唯一不同的值. 注意:1.语句中select显示的字段只能是distinct指定的字段,其他字段是不可能出现的. 2.distinct必须放在开头 如select disti ...

  10. nginx、fastCGI、php-fpm关系梳理

    前言: Linux下搭建nginx+php+memached(LPMN)的时候,nginx.conf中配需要配置fastCGI,php需要安装php-fpm扩展并启动php-fpm守护进程,nginx ...