垂直居中:
           先height再ling-height,都设成一样高

span 垂直居中:vertical-align:50%
设置外边距:
           margin-top,margin-left,margin-right,margin-bottom
div背景单张铺满设置:
           width: 30px;
           height: 30px;
           line-height: 30px;
           background-image: url(../image/lzhf/one.png);
           background-repeat: no-repeat;
           background-size: 100% auto;

div浮在div上:
           <div style="position: relative;height: 30px;width: 100%">
              <div style="height: 30px; overflow: hidden;position: absolute;z-index: 2;width: 100%;">
                  <img alt="主要职责" style="width: 100%; height: 30px;"
                      src="../../image/ljfy/zcjgtop.png">
              </div>

<div style="position: absolute;z-index: 3;margin-left:10px;height: 30px;line-height: 30px;">
                  <img src="../../image/ljfy/zyzzc.png" width="30" height="30">
              </div>
              <div style="position: absolute;z-index: 3;margin-left: 38px;height: 30px;line-height: 30px;">
                  <font style="font-weight: bold">共有内设机构20个</font>
              </div>
          </div>

解决非固定宽度的浮动问题:

结束加上<div style="clear:both;height: 0px;"></div>

js改变背景颜色:
document.getElementById('mycolor').style.background=yc

显示不显示:

document.getElementById("ah2").style.display = "block";

$("#id").css('display','none');

$("#id")[0].style.display = 'none';

图片在div中居中显示(水平居中和垂直居中):
水平居中:div设置:text-align:center;
img设置:width:图片宽度; margin:0 auto;

垂直居中:div设置:position:relative;
img设置:position:absolute; top:50%; height:图片高度; margin-top:图片高度的一半;

让两个Div并排显示:

<div style="width:300px; height:auto; float:left; display:inline">AAAA</div>

<div style="width:300px; height:auto; float:left; display:inline">BBBB</div>

table中的td换行:

在table定义中,添加style="table-layout:fixed;"

在对需要换行的td中,添加style="word-break:break-all;"

预打印:

分页  <br style="page-break-after: always;" />

打印时不显示

<style>
@media print {
  .noprint {
  display: none
  }
}
</style>

<tr align="center" class="noprint">

点击文字可以选中相应的checkbox  :

<input id="check1" name="tag" type="checkbox" value="长发"/><label for="check1">长发</label>

图片居中:

img{ display:block; margin:0 auto;}

优先级:

.style1{
 color: #5a5100 !important;
 text-decoration: none;
}

CSS备忘的更多相关文章

  1. Css 备忘知识点

    1.Chrome 中文界面下默认会将小于 12px 的文本强制按照 12px 显示,可通过加入 CSS 属性 -webkit-text-size-adjust: none; 2.HTML5的form如 ...

  2. CSS备忘笔记

    一.CSS的概念 CSS(Cascading Style Sheet),中文译为层叠样式表,它是用于控制网页样式并允许将样式信息与网页内容分离的一种标记性语言. 二.CSS使用方式 使用CSS控制页面 ...

  3. CSS备忘-1

    CSS 可以通过以下方式添加到HTML中: 内联样式- 在HTML元素中使用"style" 属性 内部样式表 -在HTML文档头部 <head> 区域使用<sty ...

  4. 常用CSS备忘

    1 怎样让div中的img居中 水平居中:div设置:text-align:center; img设置:width:图片宽度; margin:0 auto; 垂直居中:div设置:position:r ...

  5. [CSS备忘] css3零散

    -webkit-overflow-scrolling:touch;下拉滚动回弹

  6. [CSS备忘]改变选中文本的颜色::selection

    /*Webkit,Opera9.5+,IE9+*/ ::selection { background:red; color:white; } /*Firefox*/ ::-moz-selection ...

  7. [CSS备忘]多行文本省略号

    overflow : hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box ...

  8. CSS 备忘

    border-radius :  10px  /  40px    10表示X轴半径   40表示Y轴半径   font:italic bold 13px/13px arial,sans-serif; ...

  9. CSS系列:less备忘

    less备忘 //这是一个运行在koala中的less文件,//注释不会被编译到css文件中,/**/注释会 ****************by 李可 2016/04/19 /*所有,所有伪类*/ ...

随机推荐

  1. 最短路之Dijkstra算法

    1. 邻接矩阵 int cost[MAX_V][MAX_V]; //assume cost[u][v]>0 int d[MAX_V]; bool used[MAX_V]; void Dijkst ...

  2. 设定JS全局的公共变量

    1. 新建一个标签文件 javaScriptVariables.tag 新建一个标签文件 javaScriptVariables.tag放在 %/HelloWorldWebPro/webroot/WE ...

  3. mongodb(基础用法)

    驱动和客户端库 https://mongodb-documentation.readthedocs.org/en/latest/ecosystem/drivers.html#id2 https://m ...

  4. Hadoop 2.2.0部署安装(笔记,单机安装)

    SSH无密安装与配置 具体配置步骤: ◎ 在root根目录下创建.ssh目录 (必须root用户登录) cd /root & mkdir .ssh chmod 700 .ssh & c ...

  5. ExtJS学习之路第三步:理解引擎之下,ExtJS4中的类

    写写就发现,有些代码不查查源头,不明白是怎么回事?搜到这篇文章觉得还是收益匪浅,更容易读懂代码. Classes in Ext JS 4: Under the hood Countdown to Ex ...

  6. 关于Tabula FPGA的话题 (转)

    最近关注了一下Tabula的产品,特别是这个公司的FPGA.我的关注源于Intel对Tabula的支持.最近和在FPGA方面有较深理解的几位人士简单聊了聊,以下是这次对话的主要内容,希望能对从事这方面 ...

  7. zoj.3868.GCD Expectation(数学推导>>容斥原理)

    GCD Expectation Time Limit: 4 Seconds                                     Memory Limit: 262144 KB    ...

  8. zstu.4189: 逻辑运算(构建 && 前缀表达式入门)

    4189: 逻辑运算 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 274  Solved: 42 Description 还记得大学里学过的模电么, ...

  9. php面试题之三——PHP语言基础(基础部分)

    三.PHP语言基础 1. strlen( )与 mb_strlen( )的作用分别是什么(新浪网技术部) strlen和mb_strlen都是用于获取字符串长度. strlen只针对单字节编码字符,也 ...

  10. SpringMVC配置easyui-datagrid

    SprimgMVC的UserController.java @RequestMapping(value = "listUserForJson") @ResponseBody pub ...