1.input placeholder   文字居中   字体大小+上下padding值等于设计稿宽度 

设计稿中总高度为86px
 


padding:27px 0;font-size:30px;
 
2.英文 文本换行
 
word-break:break-all;
word-wrap:break-word;

3.注意IE下的渐变写法,

引入pie文件之后

-pie-background: linear-gradient(#c9c9c9, #fff);

.nav_box{width:100%;height:50px;position:relative;
background: #ccc;
background: -webkit-linear-gradient(bottom, #c9c9c9, #fff);
background: -moz-linear-gradient(bottom, #c9c9c9, #fff);
background: -o-linear-gradient(bottom, #c9c9c9, #fff);
background: linear-gradient(to top, #c9c9c9, #fff);
-pie-background: linear-gradient(#c9c9c9, #fff);
behavior: url(PIE_uncompressed.htc);

4.表格代码片段

html:

<div class="level_score_table">
<table>
<thead>
<tr>
<td class="w150 table_left_title table_color01">信用等级</td>
<td class="w110 table_color02">A</td>
<td class="w110 table_color03">B</td>
<td class="w110 table_color04">C</td>
<td class="w110 table_color05">D</td>
<td class="w110 table_color06">E</td>
</tr>
</thead>
<tbody>
<tr>
<td class="table_left_title">信用分数</td>
<td>31-60分</td>
<td>31-60分</td>
<td>31-60分</td>
<td>31-60分</td>
<td>0-30分</td>
</tr>
</tbody>
</table>
</div>

  

.level_score_table{width: 704px;background: #dcdcdc;margin: 0 auto;
& table{border-collapse: separate;
border-spacing: 1px;
& thead tr{background:#f47908;& td{color: #FFF !important;}}
& tbody tr{background:#ffffff;& td{color: #333333;}}
& tr{background:#ffffff;
& td{border-spacing: 1px;text-align: center;color: #f1740f;padding: 18px 0px;font-size: 20px;}
}
}
}
.w150{width: 150px;}
.w110{width: 110px;} .table_left_title{font-family: $yahei;font-size: 18px;}
.table_color01{background: #f47908;}
.table_color02{background: #f47908;}
.table_color03{background: #f68721;}
.table_color04{background: #fc993e;}
.table_color05{background: #fda656;}
.table_color06{background: #ffba7b;}

单元格合并

当需要合并单元格,即有的元素占用两行,有的元素占用两列。这时,用到了以下属性:

rowspan占n列

colspan占n行

<div class="level_score_table02">
<table>
<thead>
<tr>
<td class="w185 table_left_title "></td>
<td class="w310 table_left_title">项 目</td>
<td class="w84 table_left_title">状 态</td>
<td class="w125 table_left_title">信用分数</td>
</tr>
</thead>
<tbody>
<tr>
<td class="table_left_title" rowspan="3">基本信息</td>
<td>31-60分</td>
<td>31-60分</td>
<td>31-60分</td>
</tr>
<tr>
<td>31-60分</td>
<td>31-60分</td>
<td>31-60分</td>
</tr>
<tr>
<td>31-60分</td>
<td>31-60分</td>
<td>31-60分</td>
</tr>
<tr>
<td class="table_left_title" rowspan="3">基本信息</td>
<td>31-60分</td>
<td>31-60分</td>
<td>31-60分</td>
</tr>
<tr>
<td>31-60分</td>
<td>31-60分</td>
<td>31-60分</td>
</tr>
<tr>
<td>31-60分</td>
<td>31-60分</td>
<td>31-60分</td>
</tr>
</tbody>
</table>
</div>
.level_score_table02{width: 704px;background: #dcdcdc;margin: 0 auto;border-radius: 2px;
& table{border-collapse: separate;
border-spacing: 1px;
& thead tr{background:#f3f3f3;& td{color: #333333 !important;}}
& tbody tr{background:#ffffff;& td{color: #333333;}}
& tr{
& td{border-spacing: 1px;text-align: center;color: #f1740f;padding: 18px 0px;font-size: 20px;}
}
}
}

5.选择下拉框

默认系统select

<div class="loan_list_select w153">
<select name="listZhiwei1" size="1">北京</select>
</div>

css:

.loan_list_select{width: 620px;height: 40px;font-size: 17px;color: #343434;float: left;position: relative;}
.loan_list_select select{ width: 100%; height: 40px;color: #333;line-height: 1.5;padding: 10px 0 ;font-size: 16px;}
效果:
IE下

谷歌浏览器下 

div标签模拟
<div class="select_box province">
<div class="selected">1000元</div>
<img src="data:images/loan/list_icon02.png" class="select_arrow" />
<div class="select_list_box" style="display:none;">
<div class="select_list">1000元</div>
<div class="select_list">2000元</div>
<div class="select_list">3000元</div>
<div class="select_list">4000元</div>
<div class="select_list">5000元</div>
</div>
</div>
// 模拟select
.select_box{width:100%;height:40px;position:absolute;left:0px;top:0px;cursor:pointer;z-index:;border: 1px solid #d5d5d5;behavior: url(PIE_uncompressed.htc);border-radius:3px ;}//注意宽度设置为100%,继承父元素的宽度
.select_box .selected{width:80%;height:40px;line-height:40px;font-size:17px;text-indent:18px;color: #343434;overflow: hidden;}//注意宽度设置为80%,并且overflow: hidden;保证文字太多不会与后面箭头重叠
.select_list_box{width:100%;/*height:150px;*//*overflow:hidden;overflow-y:scroll;*/background:#d5d5d5;}//注意1.宽度设置为100%,继承父元素的宽度。2.如果有内容太多可以放开滚动
.select_list_box .select_list{width:100%;height:40px;font-size:17px;line-height:40px;text-indent:18px;border-top:1px solid #f5f5f5;color: #FFF;}//注意宽度设置为100%,继承父元素的宽度
.select_list_box .select_list:hover{background:#c9c9c9;}
.select_arrow{position: absolute;right: 0px;top:0px;cursor: pointer;} .z_index6{z-index:;}
.z_index5{z-index:;}
.z_index4{z-index:;}
.z_index3{z-index:;}
.z_index2{z-index:;}
.z_index1{z-index:}

其他常用HTML 片段的更多相关文章

  1. C#常用代码片段备忘

    以下是从visual studio中整理出来的常用代码片段,以作备忘 快捷键: eh 用途: 类中事件实现函数模板 private void MyMethod(object sender, Event ...

  2. 36个Android开发常用代码片段

    //36个Android开发常用代码片段 //拨打电话 public static void call(Context context, String phoneNumber) { context.s ...

  3. Jquery学习总结(1)——Jquery常用代码片段汇总

    1. 禁止右键点击 ? 1 2 3 4 5 $(document).ready(function(){     $(document).bind("contextmenu",fun ...

  4. jQuery常用代码片段

    检测IE浏览器 在进行CSS设计时,IE浏览器对开发者及设计师而言无疑是个麻烦.尽管IE6的黑暗时代已经过去,IE浏览器家族的人气亦在不断下滑,但我们仍然有必要对其进行检测.当然,以下片段亦可用于检测 ...

  5. Ext.NET Ext.JS 常用代码片段摘录

    引言 最近写代码突然有"一把梭"的感觉, 不管三七二十一先弄上再说. 换别人的说法, 这应该是属于"做项目"风格法吧. 至于知识体系, 可以参考官方或者更权威的 ...

  6. python常用代码片段

    目录 Python3常用 文件处理 json处理 log日志 argparse使用 INIparser Python3常用 文件处理 class BaseMethod: @staticmethod d ...

  7. Vue3.0常用代码片段和开发插件

    Vue3 Snippets for Visual Studio Code Vue3 Snippets源码 Vue3 Snippets下载 This extension adds Vue3 Code S ...

  8. Play常用代码片段 http://www.anool.net/?p=625

    持续更新中: (1)按照降序查询: List<Entity> entities= Entity.find("order by id desc").fetch(2);   ...

  9. Android开发常用代码片段

    拨打电话 public static void call(Context context, String phoneNumber) { context.startActivity( new Inten ...

随机推荐

  1. python+pygame游戏开发之使用Py2exe打包游戏

    最近在用python+pygame 开发游戏,写完以后在分享给朋友玩的时候遇到了很大的问题,只有搭建了环境才能运行python脚本. 这会吓退99%以上的人……所以把我们的游戏打包(注意是打包而不是编 ...

  2. BZOJ4346 : [POI2016]Nadajniki

    设$f[x][j]$表示$x$点不放无线,它的儿子里放了$j$个无线,且对$x$的父亲不作要求时的最小代价. $g[x][j]$表示$x$点不放无线,要求$x$的父亲至少放$j$个无线时的最小代价. ...

  3. java Android SDK安装与环境变量配置以及开发第一个Android程序

    JAVA的安装与环境变量的配置 1.先下载JAVA,并且安装. 下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3 ...

  4. Uiautomator打包使用第三方库,报错的解决方案

    问题引源: 在做自动化过程中,想在用例执行完毕后,自动生成该用例测试报告: 报告定义为Excel格式文件,且在用例执行过程中生成. 所以我在Uiautomator工程中引用了jxl.jar,用以处理E ...

  5. The Storage Situation: Removable Storage

    http://commonsware.com/blog/2014/04/09/storage-situation-removable-storage.html There is a lot of co ...

  6. Brief introduction to Scala and Breeze for statistical computing

    Brief introduction to Scala and Breeze for statistical computing 时间 2013-12-31 03:17:19  Darren Wilk ...

  7. [百科] - CreatePen()

    CreatePen编辑[声明]HPEN CreatePen(int nPenStyle, int nWidth, COLORREF crColor);[说明]用指定的样式.宽度和颜色创建一个画笔[参数 ...

  8. 【新产品发布】发布STM8S 核心板

    搞了一些STM8的核心板供大家把玩,先上几张图: 物品购买地址: http://item.taobao.com/item.htm?spm=686.1000925.1000774.17.5GMO5M&a ...

  9. iOS 用宏定义写一个单例(Singleton)

    用如下方法定义单例 @interface singleton_interface(ClassName); @end 实现单例在 @implemention singleton_implemention ...

  10. HDR the Bungie Way PPT and demo from MSFT

    Gamefest 2006 - HDR the Bungie Way Posted By: Falagard <falagard@hotmail.com> Date: 4/26/07 9: ...