CSS备忘
垂直居中:
先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备忘的更多相关文章
- Css 备忘知识点
1.Chrome 中文界面下默认会将小于 12px 的文本强制按照 12px 显示,可通过加入 CSS 属性 -webkit-text-size-adjust: none; 2.HTML5的form如 ...
- CSS备忘笔记
一.CSS的概念 CSS(Cascading Style Sheet),中文译为层叠样式表,它是用于控制网页样式并允许将样式信息与网页内容分离的一种标记性语言. 二.CSS使用方式 使用CSS控制页面 ...
- CSS备忘-1
CSS 可以通过以下方式添加到HTML中: 内联样式- 在HTML元素中使用"style" 属性 内部样式表 -在HTML文档头部 <head> 区域使用<sty ...
- 常用CSS备忘
1 怎样让div中的img居中 水平居中:div设置:text-align:center; img设置:width:图片宽度; margin:0 auto; 垂直居中:div设置:position:r ...
- [CSS备忘] css3零散
-webkit-overflow-scrolling:touch;下拉滚动回弹
- [CSS备忘]改变选中文本的颜色::selection
/*Webkit,Opera9.5+,IE9+*/ ::selection { background:red; color:white; } /*Firefox*/ ::-moz-selection ...
- [CSS备忘]多行文本省略号
overflow : hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box ...
- CSS 备忘
border-radius : 10px / 40px 10表示X轴半径 40表示Y轴半径 font:italic bold 13px/13px arial,sans-serif; ...
- CSS系列:less备忘
less备忘 //这是一个运行在koala中的less文件,//注释不会被编译到css文件中,/**/注释会 ****************by 李可 2016/04/19 /*所有,所有伪类*/ ...
随机推荐
- HDU2222 Keywords Search [AC自动机模板]
Keywords Search Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others ...
- maven 热部署成功案列
首先配置tomcat-user.xml,这个文件是在tomcat的conf文件夹下面 在</tomcat-users>前添加这段 <role rolename="admin ...
- HD1847 Good Luck in CET-4 Everybody!(巴什博弈)
巴什博弈: 一堆物品n个,最多取m个,最少取1个,最后取走的人获胜 分析:只要保证取玩最后剩m+1个,则必定胜利,所以构造m+1,只要n是 m+1的倍数,则先手必败,每次先手取玩,后手可取使得剩下的仍 ...
- 找出进程中各线程cpu消耗情况
以root用户执行以下命令,以PID 5423举例: 1,根据top命令,找到占用CPU高的进程,找到PID PID USER PR NI VIRT RES SHR S %CPU ...
- [转载]高效使用matlab之四:一个加速matlab程序的例子
原文地址:http://www.bfcat.com/index.php/2012/11/speed-up-app/ 这篇文章原文是matlab网站上的,我把它翻译过来同时自己也学习一下.原文见这里 这 ...
- Jmeter安装使用教程
解压jakarta-jmeter-X.X.zip至至如c盘:C:/jakarta-jmeter-2.2目录下. 桌面上选择“我的电脑”(右键),高级, 环境变量, 在“系统变量”---> ...
- linux基本命令(2)-备份压缩命令
一.tar命令 .解压文件 .tar.gz -C /opt (解压到/opt下) / /opt/tomcat (建立链接文件) 二.zip命令 // 1.把/home目录下面的mydata目录压缩为m ...
- 用C语言画一个“爱心”
/*每个main函数代表一种形状*/#include<iostream> using namespace std; #include<stdio.h> #include< ...
- C++编程思想重点笔记(上)
C和C++指针的最重要的区别在于:C++是一种类型要求更强的语言.就void *而言,这一点表现得更加突出.C虽然不允许随便地把一个类型的指针指派给另一个类型,但允许通过void *来实现.例如: b ...
- git 笔记- 概念
本文参考书中内容 http://cnpmjs.org/ 镜像文件 下载插件的镜像 可参考fis 对于任何一个文件,在Git 内都只有三 种状态:已提交(committed),已修改(modified) ...