图片排满一行。左右两端无间隙。

<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代码块的更多相关文章

  1. 常用CSS代码大全(工作必备)

    用html+css可以很方便的进行网页的排版布局,但不是每一种属性或者代码我们都铭记于心,最近我把CSS中的常用代码进行了归纳总结,方便自己以后查看,同时也分享给大家,希望对你们有用. 一.文本设置 ...

  2. discuz内置常用CSS代码分析

    CSS多IE下兼容HACK写法 所有 IE浏览器适用:.ie_all .foo { ... } IE6 专用:.ie6 .foo { ... } IE7 专用:.ie7 .foo { ... } IE ...

  3. !!!常用JS代码块 (jquery)

    jquery代码块 <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> ...

  4. !!!常用CSS代码

    http://www.cnblogs.com/qq21270/p/4854643.html 伪类 http://www.cnblogs.com/qq21270/p/4891167.html CSS3动 ...

  5. 常用css代码(scss mixin)

    溢出显示省略号 参过参数可以只是单/多行. /** * 溢出省略号 * @param {Number} 行数 */ @mixin ellipsis($rowCount: 1) { @if $rowCo ...

  6. 常用CSS代码片段常见css bug

    1.禁止文字被选中 .unselectable { -moz-user-select: -moz-none; -khtml-user-select: none; -webkit-user-select ...

  7. Android常用功能代码块

    1.设置activity无标题,全屏 // 设置为无标题栏 requestWindowFeature(Window.FEATURE_NO_TITLE); // 设置为全屏模式 getWindow(). ...

  8. Android常用功能代码块(转)

    1.设置activity无标题,全屏 // 设置为无标题栏 requestWindowFeature(Window.FEATURE_NO_TITLE); // 设置为全屏模式 getWindow(). ...

  9. 常用CSS代码片断

    单行文本截字 .nowrap { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; word-break: normal; ...

随机推荐

  1. for in& for each in &for of

    for...in语句以任意顺序遍历一个对象的可枚举属性.对于每个不同的属性,语句都会被执行. 语法 for (variable in object) {...} variable 在每次迭代时,将不同 ...

  2. ef core中如何实现多对多的表映射关系

    文档:https://docs.microsoft.com/en-us/ef/core/modeling/relationships class MyContext : DbContext { pub ...

  3. Spring手动提交事务

    // name的值根据spring配置文件的事物管理器的id而定 @Resource(name="transactionManager") private DataSourceTr ...

  4. 小组互评Alpha版本

    Thunder——爱阅app(测评人:任思佳) 一.基于NABCD评论作品,及改进建议 每个小组评论其他小组Alpha发布的作品:1.根据(不限于)NABCD评论作品的选题:2.评论作品对选题的实现效 ...

  5. web-msg-send 学习 http://www.workerman.net/web-sender

    WEB消息推送框架 web-msg-sender是一款web长连接推送框架,采用PHPSocket.IO开发,基于WebSocket长连接通讯,如果浏览器不支持WebSocket则自动转用comet推 ...

  6. #考研笔记#计算机之word问题

    Word 问题:1. 如何为文档加密保存?单击 office 按钮\另存为\工具按钮\常规选项\设置打开文件时的密码 2. 怎样在横格稿纸中录入古诗?单击 office 按钮\新建\模板\信纸\稿纸( ...

  7. 备忘:EBS参考链接

    帮助手册查阅网址http://docs.oracle.com/cd/V46499_01/current/html/docset.html  官方 http://www.oracleappshub.co ...

  8. 【SpringBoot】搜索框架ElasticSearch介绍和整合SpringBoot

    ========================12章 搜索框架ElasticSearch介绍和整合SpringBoot ============================= 加入小D课堂技术交 ...

  9. 生产redis client 连接无法释放

    原因是spring配置文件,开启了事务导致的,redis是缓存用的,不需要开启事务,正确的配置如下: <!--redis操作模版,使用该对象可以操作redis --> <bean i ...

  10. 为什么redis使用单线程还能这么快?

    通常来讲,单线程处理能力要比多线程差,但是redis为什么就快了,这主要得益于以下几个原因: 1.纯内存访问,redis将所有数据放在内存中,内存的响应时长大约为100纳秒,这是redis达到每秒万级 ...