!!!常用CSS代码块
图片排满一行。左右两端无间隙。
<style type="text/css">
.img_abc{float:left;width:30%;margin-left:5%;}
.img_abc:first-child{margin-left:0}
.body92{margin-left:4%;margin-right:4%;}
</style>
<div class="body92">
<img src="1408587440309.png" class="img_abc">
<img src="1408587445662.png" class="img_abc">
<img src="1408587456115.png" class="img_abc">
</div>
用图片替代:文件上传按钮
<div class="file-box">
<input type="file" id="focusPic" name="focusPic" class="fileupload-hidden" onchange="showCurrentImg('focusImg')">
<img src="http://images.csdn.net/20140820/up.jpg" class="img-file-btn">
</div>
<style type="text/css">
.file-box{position: relative;width: 120px;height: 90px;overflow: hidden;border: 1px solid #F0F0F0;}
.fileupload-hidden {width: 120px;height: 90px;position: absolute;left: 0;top: 0;right: 0;bottom: 0;z-index: 2;margin: 0;padding: 0;font-size: 1000px;opacity: 0;filter: alpha(opacity=0);}
.img-file-btn {position: absolute;left: 0;top: 0;right: 0;bottom: 0;width: 100%;height: 100%;z-index: 1;}
</style>
div居中
.main{clear:both;width:1000px;margin:0 auto;} /*常规写法*/
.main{clear:both;width:1000px;margin-left:auto;marght-right:auto;} /*改良写法*/
屏幕居中
<style type="text/css">
div{position:fixed;margin:auto;left:0;right:0;top:0;bottom:0;width:200px;height:150px;background:#f90;line-height:150px;text-align:center;}
</style>
<div id="dd">屏幕居中</div>
两列:左边一列宽200px,右边一列充满剩余宽度
<style type="text/css">
div{border:1px solid #000;}
.box{overflow:auto;margin:0 auto;width:1000px;}
.left{width:200px;float:left;}
.right{margin-left:200px;}
</style>
<div class="box">
<div class="left">的的的的的的的的的</div>
<div class="right">啊啊啊啊啊啊啊啊啊啊</div>
</div>
字体效果
<style type="text/css">
h1{margin:20px 0 30px 0;padding:0;line-height:115px;font-size:120px;font-weight:bold;text-shadow:0 0 15px rgba(0,0,0,0.5);}
</style>
<div style="background:#069;">
<h1 style="color:#FFF;">WATCH</h1>
</div>
<div style="background:#FFF;">
<h1 style="color:#000;">WATCH</h1>
</div>
在链接的前后,用css添加内容
<style type="text/css">
a:before{content: "["attr(href)"]"; color:#f90;font-weight:bold;}
a:after{content: "[点击链接]"; color:#f90;font-weight:bold;}
</style>
<a href="http://www.w3school.com.cn" target="_blank">在链接的前后添加内容</a>
http://sandbox.runjs.cn/show/lvgpes2k 利用HTML5 的Datalist 元素实现输入提示 2014-9-15
!!!常用CSS代码块的更多相关文章
- 常用CSS代码大全(工作必备)
用html+css可以很方便的进行网页的排版布局,但不是每一种属性或者代码我们都铭记于心,最近我把CSS中的常用代码进行了归纳总结,方便自己以后查看,同时也分享给大家,希望对你们有用. 一.文本设置 ...
- discuz内置常用CSS代码分析
CSS多IE下兼容HACK写法 所有 IE浏览器适用:.ie_all .foo { ... } IE6 专用:.ie6 .foo { ... } IE7 专用:.ie7 .foo { ... } IE ...
- !!!常用JS代码块 (jquery)
jquery代码块 <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> ...
- !!!常用CSS代码
http://www.cnblogs.com/qq21270/p/4854643.html 伪类 http://www.cnblogs.com/qq21270/p/4891167.html CSS3动 ...
- 常用css代码(scss mixin)
溢出显示省略号 参过参数可以只是单/多行. /** * 溢出省略号 * @param {Number} 行数 */ @mixin ellipsis($rowCount: 1) { @if $rowCo ...
- 常用CSS代码片段常见css bug
1.禁止文字被选中 .unselectable { -moz-user-select: -moz-none; -khtml-user-select: none; -webkit-user-select ...
- Android常用功能代码块
1.设置activity无标题,全屏 // 设置为无标题栏 requestWindowFeature(Window.FEATURE_NO_TITLE); // 设置为全屏模式 getWindow(). ...
- Android常用功能代码块(转)
1.设置activity无标题,全屏 // 设置为无标题栏 requestWindowFeature(Window.FEATURE_NO_TITLE); // 设置为全屏模式 getWindow(). ...
- 常用CSS代码片断
单行文本截字 .nowrap { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; word-break: normal; ...
随机推荐
- JVM的永久代会发生垃圾回收吗?
垃圾回收不会发生在永久代中.当永久代满或者超过临界值时,就会触发完全垃圾回收(Full GC).如果仔细查看垃圾收集器中的输出信息,就会发现永久代也是被回收的.这就是正确的永久代大小对避免Full G ...
- python异常处理机制
python有五种异常处理机制,分别是 1.默认异常处理器. 如果我们没有对异常进行任何预防,那么程序在执行过程中发生异常就会中断程序,调用python默认的异常处理器,并在终端输出异常信息,如图所示 ...
- Angular4.0.0正式发布,附新特性及升级指南
本文首发地址:Angular4.0.0正式发布,附新特性及升级指南 作者|孙薇 编辑|尾尾 经历了6个RC版本之后,Angular项目组终于发布了新版,即正式版 Angular 4.0.0.新版的 A ...
- ionic3 使用swiper插件 实现轮播效果
由于app的更新迭代 我需要完成新版本设计图的开发 刚开始就遇到一个问题 首页的banner图需要实现某种效果 而ionic3自带的轮播图效果怎么改都改不到我想要的效果 效果图如下 自动播放 不断 ...
- Spring中的@Bean注解、@Configuration注解、@Value
1.首先是注册bean类:@Component.@Responsitory.@Controller.@Service.Configuration这些注解是把要实例化的对象装化成一个bean,放到Ioc ...
- 解决 windows下安装Anaconda后python pip不可用的情况
在windows系统下通过安装Anaconda的方式安装的python使用中发现不能再通过pip安装python包.只能通过conda install packname 的方法,导致很多conda不支 ...
- rsync的daemon模式
官方文档:https://download.samba.org/pub/rsync/rsyncd.conf.html 1:daemon模式配置文件 rsync以daemon方式运行 ...
- ElasticSearch的lowlevelApi和低级别API
之前开发使用的其实都是lowLevel的api,所谓lowlevelapi就是操作ES的json字符串要自己去写:所谓highlevel的api就是指将查询的json字符串给对象化,创建一个Searc ...
- div遮盖,弹出层
<html> <head> <title>LIGHTBOX EXAMPLE</title> <meta charset=& ...
- mysql 启动失败,数据恢复
mysql 启动失败,数据恢复 2017年02月13日 16:46:36 阅读数:621 Forcing InnoDB Recovery提供了6个等级的修复模式,需要注意的是值大于3的时候,会对数据文 ...