!!!常用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; ...
随机推荐
- RabbitMQ使用介绍及实例
消息列队不做过多解释了,直接讲讲rabbitmq的基本概念和路由模式. 一.安装及基本概念 rabbitmq是基于erlang编写的,所以安装rabbitmq之前需要安装erlang的环境,配置环境变 ...
- LeetCode 47 全排列II
题目: 给定一个可包含重复数字的序列,返回所有不重复的全排列. 示例: 输入: [1,1,2] 输出: [ [1,1,2], [1,2,1], [2,1,1] ] 解题思路: 与上一题相比,这题多了一 ...
- windows10 vs2017 C++连接MySQL
安装mysql8.0 x64 创建test数据库,user表,插入数据如下: +----+------+----------+-----------------+ | id | name | pass ...
- windows 重装系统
转载:https://blog.csdn.net/qq_41137650/article/details/80035921 老毛桃 大白菜都可以 电脑系统安装步骤我选的是用U盘做的系统 如果本计系 ...
- Open Nginx gzip
默认情况下,Nginx的gzip压缩是关闭的, gzip压缩功能就是可以让你节省不少带宽,但是会增加服务器CPU的开销哦,Nginx默认只对text/html进行压缩 ,如果要对html之外的内容进行 ...
- Sublime Keymap 设置
深深受 Emacs 组合键的影响,在编辑的时候使用组合键快速移动,而不比像 VIM 需要切换模式,但不得不吐槽 Emacs 的插件安装那个叫恶心,所以尝试了新生代产品 Sublime,但是还是离不开 ...
- Cocos2dx利用intersectsRect函数检测碰撞
if (sp1->boundingBox().intersectsRect(sp2->boundingBox())) { pLabel->setString(“碰撞飞机爆炸”); } ...
- “轻量级JavaEE”之新学期目标
我以后的职业目标是做一名Java开发工程师.之前学了一些JAVA的基础知识,也学了一些C,但以现在的知识储备和实战能力是不能胜任企业开发实战的要求的,所以这门“轻量级JavaEE企业应用实战”对我的提 ...
- robot framework浏览器与驱动的匹配
一.谷歌浏览器和火狐浏览器与驱动不匹配产生的问题 1.若在运行过程中出现[Unable to find a matching set of capabilities ][ WebDriverExcep ...
- Python开发 基礎知識 3.類別&方法 (bool & str) (未完待續)
類別 可使用type()查看 內建 [ 布爾:bool (Boolen) 字串:str (String) 數字:int (Integer) 小數:float 列表:list 元祖:tuple 字典:d ...